Hacker News new | ask | show | jobs
by vaylian 355 days ago
It would set a[i] to zero instead of swapping two values, right?
1 comments

Yes. Now we only need a legit use case for code that swaps values only if they are in different locations, otherwise zeroes the aliased location. Then we can finally do it using the xor swap!