I understand that with emplace_back
you provide it constructor arguments, and with push_back
you provide it with a copy from which to copy. However when passing the type that the element type of the vector it seems to me that they might be the same, because emplace_back
will move-construct in place with the copy you provide, which is what push_back
does, right?
Unless push_back
default constructs a new object, and then uses operator=
to move the argument. In that case they would be different.