]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/scoped_array.hpp
update boost
[lyx.git] / boost / boost / scoped_array.hpp
index 070925ce7a745c45afaa11ac5892b1a54afbb21d..8c7fdcc982ce790b087769034bb3ecd85cb1def6 100644 (file)
@@ -33,6 +33,8 @@ private:
     scoped_array(scoped_array const &);
     scoped_array & operator=(scoped_array const &);
 
+    typedef scoped_array<T> this_type;
+
 public:
 
     typedef T element_type;
@@ -67,6 +69,20 @@ public:
         return ptr;
     }
 
+    // implicit conversion to "bool"
+
+    typedef T * (this_type::*unspecified_bool_type)() const;
+
+    operator unspecified_bool_type() const // never throws
+    {
+        return ptr == 0? 0: &this_type::get;
+    }
+
+    bool operator! () const // never throws
+    {
+        return ptr == 0;
+    }
+
     void swap(scoped_array & b) // never throws
     {
         T * tmp = b.ptr;