4 ms·
https://cantrip.org/swap_if.pdf https://cantrip.org/swap_if.pdf It probably depends on a core language accommodation because bitwise-swapping objects, or even
by ncmncm 5y ago
https://cantrip.org/swap_if.pdf https://cantrip.org/swap_if.pdf
It probably depends on a core language accommodation because bitwise-swapping objects, or even primitive elements of objects, with constructors is UB.
Arthur O'Dwyer's P1144 https://wg21.link/p1144 https://wg21.link/p1144 explores that territory too.
Gcc has weird limits on generating CMOV instructions to implement this sort of optimization.