Can somebody explain this code:
void Move(Person& lhs, Person&& rhs)
{
lhs = rhs; //invokes copy assignment instead of move assignment
//lhs = (Person&&) rhs; //casting to && invokes move assignment.
}
Can somebody explain this code:
void Move(Person& lhs, Person&& rhs)
{
lhs = rhs; //invokes copy assignment instead of move assignment
//lhs = (Person&&) rhs; //casting to && invokes move assignment.
}