3 ms·
Vector has a good move assignment which also works. Why swap when you can move? Swap is additionally risky because someone can ADL specialize it for their own
by AstralStorm 8y ago
Vector has a good move assignment which also works. Why swap when you can move?
Swap is additionally risky because someone can ADL specialize it for their own purposes. (which is the point) And suddenly your move assignment is broken.
So people work around it by adding using std::swap clause there...
And then you're calling all those destructors.