2 ms·
while you can indeed swap in-place for PODs [1], this is not true for c++ objects. Also, in-place swapping is not sufficient for in-place sorting. [1] example:
by utopcell 7y ago
while you can indeed swap in-place for PODs [1], this is not true for c++ objects. Also, in-place swapping is not sufficient for in-place sorting.
[1] example: int a, b; a ^= b ^= a ^= b;