lundi 3 août 2015

Rationale for spelling of nullptr (w.r.t. no use of underscore when it is used in e.g unique_ptr)

The names of the smart pointer types std::unique_ptr and std::shared_ptr contain an underscore (_), whereas the keyword nullptr doesn't. So I'm curious: What, if any, is the rationale for using or not using an underscore in the keyword nullptr?

Note: I know nullptr is a keyword serving as null pointer constant, of type nullptr_t, whereas std::unique_ptr is a type. So maybe the rationale is related to keywords not having underscores whereas types often do. Seems a little thin, but maybe. Or perhaps the rationale is related to use of null_ptr versus nullptr in heritage code?

Aucun commentaire:

Enregistrer un commentaire