From 662cf14bf68e16fd7aa5691ee7ec62926f2fd33b Mon Sep 17 00:00:00 2001 From: Daniel Frey Date: Wed, 30 Jul 2003 21:32:19 +0000 Subject: [PATCH] Initial version [SVN r19372] --- safe_bool_testable_test.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 safe_bool_testable_test.cpp diff --git a/safe_bool_testable_test.cpp b/safe_bool_testable_test.cpp new file mode 100644 index 0000000..0a072d2 --- /dev/null +++ b/safe_bool_testable_test.cpp @@ -0,0 +1,37 @@ +// Boost safe_bool_testable test program -----------------------------------// + +// (C) Copyright Daniel Frey 2003. Permission to copy, use, modify, sell +// and distribute this software is granted provided this copyright +// notice appears in all copies. This software is provided "as is" without +// express or implied warranty, and with no claim as to its suitability for +// any purpose. + +// See http://www.boost.org for most recent version including documentation. + +// Revision History +// 30 Jul 03 Initial version (Daniel Frey) + +#include + +namespace +{ + struct X + : private boost::bool_testable< X > + { + operator bool() const + { + return true; + } + }; +} + +int main() +{ + X x; + + int i = x; // Should cause compile time error + + i = i; // Surpress warnings which has nothing to do with the test + + return 0; +} // main