question about operator bool() const
when checking if an object has valid data do we need to check every private member of the class or only one?
For example:
In the OOP notes the conversion operator for bool only checks that one member is not zero or true
Like this:
Long story short do we need to check every member is true or only one for it to be considered valid data in an object?
For example:
In the OOP notes the conversion operator for bool only checks that one member is not zero or true
Like this:
Student::operator bool() const { return no != 0; }Long story short do we need to check every member is true or only one for it to be considered valid data in an object?