Remarks: Causes reallocation if the new size is greater than the old capacity
. Reallocation invalidates all the references, pointers, and iterators
referring to the elements in the sequence, as well as the past-the-end iterator
. If no reallocation happens, then
references, pointers, and iterators
before the insertion point remain valid
but those at or after the insertion point,
including the past-the-end iterator,
are invalidated
. If an exception is thrown other than by
the copy constructor, move constructor,
assignment operator, or move assignment operator of
T or by any
InputIterator operation,
there are no effects
. If an exception is thrown while inserting a single element at the end and
T is
Cpp17CopyInsertable or
is_nothrow_move_constructible_v<T>
is
true, there are no effects
. Otherwise, if an exception is thrown by the move constructor of a non-
Cpp17CopyInsertable
T, the effects are unspecified
.