Both
push_back
and
emplace_back
move when provided with an object of type
A&&
. The thing with moving an object is that it doesn't prevent the destructor being called, because cleanup may still need to occur. There are proposals to allow programmers to indicate that objects are trivially movable to avoid superfluous destructor calls, but those haven't been accepted into the standard yet. —
J. Antonio Perez 41 secs ago