But it will use the =() operator if the type T provides it(qSwap is a template function).operator=() should never be used for a swap operation. Why use deep copies if, after the function call, you still end up with exactly the same dynamic data? A shallow copy only moves the pointers around (and the primitive types). For the swap function this should be enough. And I'd be surprised if the standard C++ implementation did it differently.
Otherwise it is just a memcpy over the destination.
Bookmarks