i'm defining returnvalue class in c++ needs report whether method successful. want objects of class evaluate true on success , false on error. operator override control truthiness of class?
the simple answer providing operator bool() const, might want safe bool idiom, instead of converting bool (which might in turn implicitly converted other integral types) convert different type (pointer member function of private type) not accept conversions.
Comments
Post a Comment