If vector::push_back needs to redistribute its storage, it first allocates new memory, and then moves the construction of the new element to the last position. If it throws up new memory, is freed, and nothing has changed, you get a strong guarantee of exception safety, even if the move constructor can throw it away.
If it is not thrown away, existing elements are transferred from the source store to the new store, and here the specification of the noexcept move noexcept matters. If the move can be selected and the type is CopyConstructible, then existing elements will be copied, not moved.
But in your test, you only look at how the new element is inserted into the vector, and it is always useful to use the metadata constructor for this step.
source share