Reputation: 12777
Given the code:
void foo( int&& i )
{
int* p = &i;
}
i
is an lvalue. In fact, I can take it's address through the &
operator.
Is this statement correct?
Upvotes: 2
Views: 169
Reputation: 65770
An expression's value category is completely removed from its type.
In your case, the expression i
is an lvalue, but std::move(i)
is an rvalue. An expression of rvalue reference type can be an lvalue or rvalue.
Upvotes: 4