Closed eeberhard closed 2 years ago
Where do we need that?
I was going to justify this and tag reviewers later haha. I think getters should be marked const where applicable, both for clarity and for code safety. Currently any class that holds parameter properties isn't able to read the parameters in const methods. Sometimes you want or need those methods to be const to guarantee that nothing is changed.
For example, validating a parameter requires reading the value. If the validation fails, we don't want the parameter to be updated, so it should be const. If it's not const, a user-defined override might change it anyway which is not intentional.