Look at this expression:
T t;
T& ref = t;
The ref
expression is an lvalue
or an rvalue
? I believe it's an rvalue
because ref
does not "designates a function or an object":
"An lvalue (so called, historically, because lvalues could appear on the left-hand side of an assignment expression) designates a function or an object."
[open-std draft n3092]
According to cppreference, a reference is not a object.
"The following entities are not objects: value, reference [...]"
I'm in doubt, because ref
is in the left side of =
.
I'm in doubt, because ref is in the left side of =.
ref
is a name and therefore an lvalue.
I believe it's an rvalue because ref does not "designates a function or an object"
It designates the same object as t
does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With