Why does reallocating a vector copy instead of moving the elements? [duplicate]
The short answer is that I think @BenVoigt is basically correct. In the description of reserve (§23.3.6.3/2), it says: If an exception is thrown other than by the move constructor of a non-CopyInsertable type, there are no effects. [And the description of resize in §23.3.6.3/12 requires the same.] This means that if T is CopyInsertable, … Read more