§ 3.10
From how I interpret the standard, lvalue
s, xvalue
s and prvalue
s are mutually exclusive.
Every expression belongs to exactly one of the fundamental
classifications in this taxonomy: lvalue, xvalue, or prvalue.
A literal such as 5
is a prvalue
.
— A prvalue (“pure” rvalue) is an rvalue that is not an xvalue. [
Example: The result of calling a function whose return type is not a
reference is a prvalue. The value of a literal such as 12, 7.3e5, or
true is also a prvalue. — end example ]
And in your "move" function, you get an xvalue
because:
[ Example: The result of calling a function whose return type is an
rvalue reference is an xvalue. — end example ]
As for why your assignment fails, see:
5 An lvalue for an object is necessary in order to modify the object
except that an rvalue of class type can also be used to modify its
referent under certain circumstances. [ Example: a member function
called for aobject (9.3) can modify the object. — end example ]
cppreference's page on assigment operators puts this in plainer language.
The direct assignment operator expects a modifiable lvalue as its left
operand and an rvalue expression or a braced-init-list (since C++11)
as its right operand, and returns an lvalue identifying the left
operand after modification.
So finally:
move(5) = 10
xvalue ^ prvalue ^
Reference:
Value categories