diff --git a/include/boost/scoped_array.hpp b/include/boost/scoped_array.hpp index 08155e9..e5919a4 100644 --- a/include/boost/scoped_array.hpp +++ b/include/boost/scoped_array.hpp @@ -93,7 +93,15 @@ public: return ptr != 0; } -#else +#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef T * (this_type::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const // never throws + { + return ptr == 0? 0: &this_type::get; + } + +#else typedef T * this_type::*unspecified_bool_type; diff --git a/include/boost/scoped_ptr.hpp b/include/boost/scoped_ptr.hpp index da4aeef..c36cace 100644 --- a/include/boost/scoped_ptr.hpp +++ b/include/boost/scoped_ptr.hpp @@ -110,8 +110,15 @@ public: return ptr != 0; } -#else +#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef T * (this_type::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const // never throws + { + return ptr == 0? 0: &this_type::get; + } +#else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type() const // never throws diff --git a/include/boost/shared_array.hpp b/include/boost/shared_array.hpp index b380879..5e943d9 100644 --- a/include/boost/shared_array.hpp +++ b/include/boost/shared_array.hpp @@ -102,7 +102,15 @@ public: return px != 0; } -#else +#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef T * (this_type::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const // never throws + { + return px == 0? 0: &this_type::get; + } + +#else typedef T * this_type::*unspecified_bool_type; diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index f7d80ae..d4b44e6 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -269,7 +269,15 @@ public: return px != 0; } -#else +#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef T * (this_type::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const // never throws + { + return px == 0? 0: &this_type::get; + } + +#else typedef T * this_type::*unspecified_bool_type;