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.
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.
Copyright © 2021 Jogjafile Inc.
No, because copy elision (and the so-called guaranteed copy elision) can change the constness of an object "after" construction:
What should
x.candy.cbe?