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.
<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