vendredi 2 juillet 2021

Can a C++ constructor know whether it's constructing a const object?

In C++, object constructors cannot be const-qualified.

But - can the constructor of an object of class A know whether it's constructing a const A or a non-const A?

Motivated by a fine point in the discussion regarding this question.





Aucun commentaire:

Enregistrer un commentaire