
Thank you all for such large input ;-) So the way I see it, most of us agree it would be nice to see one official safe-bool implementation tool in boost. The first question is: should it be a CRTP class, or should it be a macro, or both perhaps? I suggest we talk about the name after we answer the first question ;-) And later I will try to prepare an implementation with the compiler workarounds mentioned in this thread. CRTP class usage: struct X : public convertible_to_bool<X> { bool operator!() const { return condition; } // inherit operator unspecified_bool_t implemented in terms of the above operator! }; Macro usage: BOOST_EXPLICIT_BOOL_OPERATOR() const { return ...; } I'm not sure how the macro would be implemented, but we'll get to that once we make the choice. Right now I feel convinced to the macro version. Regards Kris