I guess I still have to learn a lot about not only C++, but object oriented programming itself. In a recent C++-project, I came across one question quite frecuently: If I have a situation where I want to pass a const reference to some object, how can I use non-const functions of that object?
Let me give an example: Say I have a class with some data and a function with a small calculation with that data, for instance
int recommendDumbbellWeight(const Person &person);
GymInstructor::recommendDumbbellWeight(float bodyMassIndex, float experience, float fitness, ...
GymInstructor::recommendDumbbellWeight(const Person &person)
Declaring a method
const is somewhat like making a promise that it won't try to modify the object. It will not deny you access to the object state and you still will be perfectly able to call it for non-const objects.
So yes, the solution is
float bodyMassIndex() const;