Reference are always lvalue?

G

George2

Hello everyone,


Is the conclusion correct? Both const reference and non-const
reference are lvalue?

I think it is true and I can not find a sample which does not follow
it.


thanks in advance,
George
 
V

Victor Bazarov

George2 said:
Is the conclusion correct? Both const reference and non-const
reference are lvalue?

I think it is true and I can not find a sample which does not follow
it.

If an expression has the type 'reference to T', it's an lvalue. See
[expr]/6. I presume by "const reference" and "non-const reference"
you actually mean "reference to const" and "reference to non-const".

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top