Whenever you define a class member function which does not (and should not) change its object, it’s a good idea to define it as a const member function. There are two advantages to that: One, you guarantee that this member function is safe to use, because it does not change the state of its objects (i.e, it may not assign new values to members, reallocate memory or activate the object