Let\'s say I got a Foo
class containing an std::vector
constructed from std::unique_ptr
objects of another class, Bar
.
Basically, every object which has a name is an lvalue. When you pass an object to a function using an rvalue reference the function actually sees an lvalue: it is named. What the rvalue reference does, however, indicate is that it came from an object which is ready to be transferred.
Put differently, rvalue references are assymmetrical:
std::move(o)
)