Why does push_back()
take Object&&
as parameter, and not simply a reference of the object, like Object&
?
What is this operator?
Why does push_back()
take Object&&
as parameter, and not simply a reference of the object, like Object&
?
What is this operator?
That would be the move operator, wich is new since c++11. This allows you to move objects into your vector instead of copying them. Google search for a more detailed descriptiob of the move operator.