glvalue

glvalue(广义左值)表达式是具有标识的任何表达式,无论它是否可以移动。此类别包括左值(具有标识但不能移动的表达式)和 xvalues(具有标识且可以移动的表达式),但不包括 prvalues(没有标识的表达式)。

如果表达式有名称,则为 glvalue:

struct X { int n; };
X foo();

X x;
x; // has a name, so it's a glvalue
std::move(x); // has a name (we're moving from "x"), so it's a glvalue
              // can be moved from, so it's an xvalue not an lvalue

foo(); // has no name, so is a prvalue, not a glvalue
X{};   // temporary has no name, so is a prvalue, not a glvalue
X{}.n; // HAS a name, so is a glvalue. can be moved from, so it's an xvalue