Say I have a C++ class that holds an array.
A member function of this class for example, could be to return the value at a certain index. I'm confident this would be considered a getter method.
However, how would you classify a similar function that instead simply returns a boolean based on whether or not the value exists in the array?
This function is 'getting' something but not necessarily a value from a member of the class. Would this still be considered a getter method?
Does it really matter? Consider this interface:
for the user of this class it should not matter at all whether implementation is this:
or this:
The second does return a member and according to your definition it would be a "getter" method. The first does not, but does it mean that it is not a true "getter" method? Whether the method actually returns a member or something else is an implementation detail and should not matter to the caller, nor should it affect the name you give to the method.