A simplified example of my situation:
I have a class with 3 member variables, all integers, e.g.
class Foo
{
public:
int A;
int B;
int C;
};
I want to have a function that returns a Boolean trueif all the member variables are 0 and falseotherwise.
Easy enough, can be performed using this member function:
bool all_zero()
{
return (A == 0 && B == 0 && C == 0);
}
I can do this if necessary.
However, in my situation this is not ideal, because:
I am not the only person who runs this software.
Sometimes new member variables are added to this class (for example, int D).
++, - , . , . .
, , all_zero (.. - , && D == 0 , -).
, ... :
all_zero , - ( int), , ? , , ( -).
, , , all_zero - , , - , all_zero.