dimanche 29 novembre 2020

What are "names which are not lvalues"?

There's an entry in the errata of Effective Modern C++ which says that

not all names are lvalues

What are these names? Specifically,

  1. is Scott just referring to the nullptr and this named prvalues?
  2. Are there any others?
  3. In case the answer to 1 is yes, then what makes nullptr special with respect to true and false? They are all values of some type (true/false of type bool, nullptr of type std::nullptr_t). After all true stays to bool just like 1 stays to int, and 1 is not a "name which is not an lvalue", is it? At this point I'd ask why is true not a name then?

Aucun commentaire:

Enregistrer un commentaire