hkaiser changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar-group.org | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | This channel is logged: irclog.cct.lsu.edu
K-ballo1 has joined #ste||ar
K-ballo has quit [Ping timeout: 276 seconds]
K-ballo1 is now known as K-ballo
hkaiser has quit [Quit: Bye!]
Yorlik__ has joined #ste||ar
<satacker[m]> Thanks for the goodies bag. 💯
hkaiser has joined #ste||ar
hkaiser has quit [Quit: Bye!]
K-ballo1 has joined #ste||ar
K-ballo has quit [Ping timeout: 276 seconds]
K-ballo1 is now known as K-ballo
Yorlik__ has quit [Read error: Connection reset by peer]
Yorlik has joined #ste||ar
rtohid[m] has joined #ste||ar
<gonidelis[m]> What does `typename decay<T1>::type` to a type of a value that it's being passed as a universal ref?
<gonidelis[m]> I am confusing types with values here smh.
<gonidelis[m]> trying to reason how the practical example will unfold https://stackoverflow.com/a/25732651/8242494 with std::decay when passing a string literal
<K-ballo> the term universal ref was replaced by forwarding ref
<K-ballo> decay_t<T> is effectively the type auto x = std::declval<T>(); would deduce
<gonidelis[m]> so in the case where a string literal is being passed as a universal ref
<gonidelis[m]> ?
<K-ballo> the term universal ref was replaced by forwarding ref
<K-ballo> what's your string literal?
<gonidelis[m]> "foo"
<K-ballo> whose type is `char const (&)[4]`
<K-ballo> .. what would auto x = "foo"; deduce?
<gonidelis[m]> had no idea this was its type
<gonidelis[m]> it would deduce `*char` ????
<K-ballo> `*char` is not a C++ type
<gonidelis[m]> what would it deduce then?
<K-ballo> you tell me
<K-ballo> you can always ask the compiler if you can't figure it out
<gonidelis[m]> lol I meant `char*`
<gonidelis[m]> (still not enough coffee yet)
<gonidelis[m]> K-ballo: with that amazing trick you showed me once
<gonidelis[m]> ?
<K-ballo> perhaps on some older compilers, these days string literals are constants
<K-ballo> (string literals have always been constant, but C didn't have const so in the old days the type was indeed `char*` but mutation would crash your program)
<gonidelis[m]> `const char *`
<gonidelis[m]> thats what the compiler gave me
<gonidelis[m]> so converts const char & is being decayed to const char *
<gonidelis[m]> scratch "converts"
<K-ballo> first it drops the ref, then it drops top-level cv qualifiers, then converts arrays and functions to pointers
<K-ballo> the conversions to pointer are the actual "decay" part
<gonidelis[m]> excellent explanation
<gonidelis[m]> i was missing the sequence. standard explains it more as in a "this or this or that" way
<gonidelis[m]> does the part where it drops the ref mean that the parameter is being copied instead of moved?
<K-ballo> auto x copies, yes
<gonidelis[m]> no i was talking about the practical example
<gonidelis[m]> where we pass the string to a function template
<K-ballo> how does it differ from auto x?
<gonidelis[m]> its different code
<K-ballo> different from what?
<gonidelis[m]> `auto x;`
<gonidelis[m]> and
<gonidelis[m]> `template <typename T>
<gonidelis[m]> foo(T&& x)`
<gonidelis[m]> is different code
<K-ballo> where's decay?
diehlpk has joined #ste||ar
diehlpk1 has joined #ste||ar
diehlpk has quit [Ping timeout: 255 seconds]
<gonidelis[m]> `template <typename T> foo(T&& x){typename decay<T1>::type x1}`
diehlpk1 has quit [Quit: Leaving.]
hkaiser has joined #ste||ar
<hkaiser> gonidelis[m]: yt?
<gonidelis[m]> hkaiser: hey
<hkaiser> see pm, pls
K-ballo1 has joined #ste||ar
diehlpk has joined #ste||ar
K-ballo has quit [Ping timeout: 260 seconds]
K-ballo1 is now known as K-ballo
diehlpk has quit [Ping timeout: 255 seconds]
diehlpk_work has joined #ste||ar
Yorlik has quit [Ping timeout: 276 seconds]
diehlpk_work has quit [Remote host closed the connection]
K-ballo1 has joined #ste||ar
K-ballo has quit [Ping timeout: 272 seconds]
K-ballo1 is now known as K-ballo