I\'m defining a ReturnValue class in C++ that needs to report whether a method was successful. I want objects of the class to evaluate to true on s
The simple answer is providing operator bool() const, but you might want to look into the safe bool idiom, where instead of converting to bool (which might in turn be implicitly converted to other integral types) you convert to a different type (pointer to a member function of a private type) that will not accept those conversions.