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
Yorlik_ has joined #ste||ar
Yorlik__ has quit [Ping timeout: 260 seconds]
K-ballo has quit [Quit: K-ballo]
hkaiser has quit [Quit: Bye!]
Yorlik_ has quit [Quit: Leaving]
hkaiser has joined #ste||ar
K-ballo has joined #ste||ar
aalekhn has joined #ste||ar
Yorlik has joined #ste||ar
<satacker[m]> gonidelis: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1895r0.pdf this was the paper for tag_invoke right?
<satacker[m]> (the one you wanted me to go throught it)
<gonidelis[m]> Yes!
<gonidelis[m]> K-ballo: not being familiar with the correspondence between compilers and C++ versions what version of clang should I use to observe this behavior?
<gonidelis[m]> "_Have you seen code that makes qualified calls to swap in a template, like std::swap( a, b ); ? Congratulation, you have probably found a bug_"
<gonidelis[m]> clang 14 compiles just fine :)
<K-ballo> if the types of a and b are dependent then it is indeed a bug
<K-ballo> it won't usually cause a miscompilation though
<gonidelis[m]> why no miscompilation?
<K-ballo> it will do a fallback 3-moves swap
<K-ballo> why do you expect a miscompilation to begin with?
<K-ballo> or for it to be clang's for that matter
<gonidelis[m]> lol true
<gonidelis[m]> ok
<gonidelis[m]> fixed it
<gonidelis[m]> still bug does not happen
<gonidelis[m]> here's the code
<K-ballo> do you understand what the bug *is*? how do you determine it does not actually happen?
<gonidelis[m]> no don't look at the code
<gonidelis[m]> sheesh
<gonidelis[m]> wait
<K-ballo> that code does not have qualified calls to (dependent) swap in a template
<K-ballo> I only see one std::swap, it's in main which is not a template
<gonidelis[m]> why does it have to be in a template?
<K-ballo> because it says so in the quote you pasted
<gonidelis[m]> still...
<gonidelis[m]> (but again, why?)
<K-ballo> the types of a and b aren't dependent
<K-ballo> they are always `type_a_namespace::A`, independent of `T`
<gonidelis[m]> dependent how?
<gonidelis[m]> dependent on what?
<K-ballo> in c++ dependent is only defined for template parameters as far as I know
<K-ballo> in your case, you need types dependent on T
<gonidelis[m]> ok it gets deeper than I expected
<gonidelis[m]> is that so ?
<K-ballo> still not dependent
<K-ballo> the types of a and b are always `type_a_namespace::A<int>`
<K-ballo> fwiw this kind of bug can happen without any templates involved (the quote is kinda weak or misguiding, unless there's more information in context)
<K-ballo> is one of the main reasons CPOs were first designed
<K-ballo> std::ranges::swap doesn't have that problem
<gonidelis[m]> I fail to understand the engineering behind that 100%
<gonidelis[m]> I do understand the effects
<gonidelis[m]> Seems like I have to do something very very specific to trigger this bug
<K-ballo> no, it's actually fairly straightforward
<K-ballo> do you understand what the bug is?
<gonidelis[m]> yes
<gonidelis[m]> the overloaded swap is installed
<gonidelis[m]> is invoked*
<K-ballo> and why is that a bug?
<gonidelis[m]> cause the user qualifies with `std::` so he wants the OG swap
<K-ballo> og?
<gonidelis[m]> original
<gonidelis[m]> the standard library one
<K-ballo> the bug is the user most likely does NOT want the standard library one
<K-ballo> if the user does indeed want the standard library one, then it's perfectly fine to qualify std::swap
<K-ballo> `swap` is a customization point, calling `std::swap` side-steps any customizations
<gonidelis[m]> sorry yes that's what i meant
<gonidelis[m]> i am dazzled
<gonidelis[m]> no that i am thinking of
<gonidelis[m]> isn't it user's fault that they call std::swap and yet they dont want std::swap?
<gonidelis[m]> if `swap` was giving `std::swap` then that would be an understandable bug
<K-ballo> the bug was created by whoever made a qualified call when they wanted the customizable one
<gonidelis[m]> yes
<gonidelis[m]> anyways... what's the way to trigger it then
<K-ballo> call qualified std::swap on something that customizes swap
<K-ballo> (something other than the standard library, which has special status)
<gonidelis[m]> how do you customize swap is my question
<K-ballo> define a swap function in an associated namespace of T
diehlpk has joined #ste||ar
Yorlik has quit [Ping timeout: 258 seconds]
hkaiser has quit [Quit: Bye!]
diehlpk has quit [Quit: Leaving.]
diehlpk has joined #ste||ar
diehlpk has quit [Client Quit]
hkaiser has joined #ste||ar
hkaiser has quit [Client Quit]
<dkaratza[m]> hkaiser_: I will not be able to join tomorrow's meeting because I have an oral examination at the same time
<dkaratza[m]> Can we transfer it maybe to Friday?
diehlpk has joined #ste||ar
diehlpk has quit [Client Quit]
diehlpk has joined #ste||ar
diehlpk has quit [Client Quit]
aalekhn has quit [Quit: Connection closed for inactivity]
hkaiser has joined #ste||ar