There's an entry in the errata of Effective Modern C++ which says that
not all names are lvalues
What are these names? Specifically,
- is Scott just referring to the
nullptrandthisnamed prvalues? - Are there any others?
- In case the answer to 1 is yes, then what makes
nullptrspecial with respect totrueandfalse? They are all values of some type (true/falseof typebool,nullptrof typestd::nullptr_t). After alltruestays tobooljust like1stays toint, and1is not a "name which is not an lvalue", is it? At this point I'd ask why istruenot a name then?
An expression
XwhereXis the name of an enumerator (declared e.g. asenum E { X };) has rvalue value category.Similarly for non-type template parameters (hat tip to @PasserBy), as in