Do I understand right that with introduction of move semantics in C++11, move can be used instead of swap-to-clear idiom in order to empty vector including storage deallocation?
std::vector<T>().swap( v );
// VS
v = std::move( std::vector<T>() );
Is the second approach guaranteed to work as the first one?
PS. As @MaximEgorushkin noted, there is no need in std::move
above since r-value is assigned.