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
nullptr
andthis
named prvalues? - Are there any others?
- In case the answer to 1 is yes, then what makes
nullptr
special with respect totrue
andfalse
? They are all values of some type (true
/false
of typebool
,nullptr
of typestd::nullptr_t
). After alltrue
stays tobool
just like1
stays toint
, and1
is not a "name which is not an lvalue", is it? At this point I'd ask why istrue
not a name then?
Aucun commentaire:
Enregistrer un commentaire