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 12 Mar 2003 18:58:40 -0000 @@ -302,6 +302,18 @@ } }; +// 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 +{ + friend bool operator!(const T& t) { return !static_cast(t); } +private: + typedef signed char private_number_type; + operator private_number_type() const; +}; + // More operator classes (contributed by Daryle Walker) --------------------// // (NRVO-friendly implementation contributed by Daniel Frey) ---------------//