]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/scoped_ptr.hpp
Boost 1.31.0
[lyx.git] / boost / boost / scoped_ptr.hpp
index 19396a59ffb58c6acbac8892f78b6ef4ef98f3f5..c36cacead33a823840ed5f2a1506a8eefc37f6b4 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <boost/assert.hpp>
 #include <boost/checked_delete.hpp>
+#include <boost/detail/workaround.hpp>
 
 #ifndef BOOST_NO_AUTO_PTR
 # include <memory>          // for std::auto_ptr
@@ -102,13 +103,31 @@ public:
 
     // implicit conversion to "bool"
 
-    typedef T * (this_type::*unspecified_bool_type)() const;
+#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
+
+    operator bool () const
+    {
+        return ptr != 0;
+    }
 
+#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
+    {
+        return ptr == 0? 0: &this_type::ptr;
+    }
+
+#endif
+
     bool operator! () const // never throws
     {
         return ptr == 0;