Index: boost/operators.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/operators.hpp,v retrieving revision 1.14 diff -u -r1.14 operators.hpp --- boost/operators.hpp 26 Feb 2003 21:26:57 -0000 1.14 +++ boost/operators.hpp 27 Feb 2003 10:47:54 -0000 @@ -302,6 +302,21 @@ } }; + +// bool_testable contributed by Sam Partington, David Abrahams, ------------// +// and Daniel Frey. Original concept taken from shared_ptr by Peter Dimov -// + +template +struct bool_testable : B +{ + typedef void (bool_testable::*unspecified_bool_type)() const; + operator unspecified_bool_type() const + { + return !static_cast(*this) ? 0 : reinterpret_cast(&bool_testable::operator unspecified_bool_type); + } +}; + + // More operator classes (contributed by Daryle Walker) --------------------// // (NRVO-friendly implementation contributed by Daniel Frey) ---------------//