|
|
|
|
|
by munchbunny
2471 days ago
|
|
That's just not how C++ is designed. If you want const, you stick const on the member variables or declare member getter functions const. Then the language checks your work when you initialize an object into a constant variable. This allows you to force an object to be immutable at a compiler enforced level regardless of how the calling code tries to initialize it. |
|