Is the capacity required to be preserved when moving a std::vector?
Consider the following code: std::vector vec; vec.reserve(500); size_t cap = vec.capacity(); std::vector newVec = std::move(vec); assert(cap == newVec.capacity()); In pretty much any implementation you run across, this will work. I don't care about what implementations do. I want to know what the standard requires . Will the moved-to vector have the same capacity as the original? Or will the assert trigger? Looking at the standard, it appears that nothing is required from the move constructor, however as @amaurea says, it would completely defeat the purpose of move semantics if the move