Is xvalue both glvalue and rvalue?

39 views
Skip to first unread message

piotrek...@gmail.com

unread,
Oct 23, 2016, 12:24:34 PM10/23/16
to ISO C++ Standard - Discussion
After reading section"Lvalues and rvalues" [basic.lval] in the standard (this version), I can't figure out if xvalue expressions are glvalues or rvalues?

There are two ways that it can be understood, please tell me which is right.

1. Every expression that is xvalue, is a glvalue expression and is also an rvalue expression.

2. Some xvalue expressions are glvalues (but not rvalues), while the rest are rvalues (but not glvalues).

It might be a good idea to add such information to the standard so that the standard is explicit about that.

Thank you,
Piotr

Nicol Bolas

unread,
Oct 23, 2016, 2:33:36 PM10/23/16
to ISO C++ Standard - Discussion, piotrek...@gmail.com

In what way did the diagram in paragraph 1 of [basic.lval] not make this clear? The diagram clearly shows `xvalue` descending from both `glvalue` and `rvalue`. So it is both.

1.4 and 1.5 also describe `rvalue` and `lvalue` in a way that makes things clear.
Reply all
Reply to author
Forward
0 new messages