Daniel Frey wrote: > > The only problem I see is that an instance of safe_bool_conversion is > created which is not really needed. I suggest to rely on the operator! > provided by T: > > template< class T, class B = ::boost::detail::empty_base > > struct bool_testable : B > { > private: > typedef bool (T::*unspecified_bool_type)() const; > > public: > operator unspecified_bool_type() const > { > return !static_cast< const T& >( *this ) ? 0 : &T::operator!();
Should be ...operator!; without the braces, sorry. > } > }; It has another advantage: It makes the compiler complain if the user didn't provided an operator! with the right signature. This is - in this case and IMHO - a good thing. Regards, Daniel -- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: [EMAIL PROTECTED], web: http://www.aixigo.de _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost