Reputation: 1281
void SomeClass::setName(std::string name)
{
name_ = std::move(name);
}
Is this explicit std::move()
redundant for the compiler?
Upvotes: 1
Views: 124
Reputation: 238421
Is this explicit std::move() redundant for the compiler?
No. Without std::move()
the operand would be an lvalue and thus you would be using the copy assignment operator.
Upvotes: 3