Re:C++ Programming Questions to Ask on Interview (2017)
by AstralStorm on Friday October 19, 2018 @02:27AM
(#18254583)
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...
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.