If a member function that returns a member variable staticshould also be static?
static
For instance:
struct T { static int i; static int getNumber() { return i; } };
Should it getNumberbe staticor not?
getNumber
Usually yes.
If a variable does not have any state for each instance, then what possible logic for each instance could function on it before returning it?
It's not obligatory. you can write a member function that returns a static variable. You cannot go the other way around (write a static function that returns an instance variable).
, , , . ,