2 ms·
Movement semantics actually existed for vector assignment since the original C++98 STL specification. Movement semantics didn't exist in the language per se, b
by dragontamer 8y ago
Movement semantics actually existed for vector assignment since the original C++98 STL specification.
Movement semantics didn't exist in the language per se, but they were supported back then by std::swap and std::auto_ptr. Today, it is far easier to represent movement semantics with RValues, std::move, and std::unique_ptr.
But yeah, std::vector's assignment operator was originally at least std::swap based and therefore efficient.