]> Dogcows Code - chaz/yoink/blobdiff - src/stlplus/containers/smart_ptr.hpp
import stlplus 3.7
[chaz/yoink] / src / stlplus / containers / smart_ptr.hpp
index 2d37e2e4314f5f7fc9a3539f2a23f89e75ac7a9e..18b496e5a70b832457aabceff10d2bb7d14d25d7 100644 (file)
@@ -4,7 +4,7 @@
 \r
 //   Author:    Andy Rushton\r
 //   Copyright: (c) Southampton University 1999-2004\r
-//              (c) Andy Rushton           2004-2009\r
+//              (c) Andy Rushton           2004 onwards\r
 //   License:   BSD License, see ../docs/license.html\r
 \r
 //   A smart pointer is a memory-managing pointer to an object. If you like, it\r
@@ -61,11 +61,6 @@ namespace stlplus
     // create a null pointer\r
     smart_ptr_base(void);\r
 \r
-    // create a pointer containing a *copy* of the object using the template parameter C\r
-    // this copy is taken because the pointer class maintains a dynamically allocated object\r
-    // and the T& may not be (usually is not) dynamically allocated\r
-    explicit smart_ptr_base(const T& data) throw(illegal_copy);\r
-\r
     // create a pointer containing a dynamically created object\r
     // Note: the object must be allocated *by the user* with new\r
     // constructor form - must be called in the form smart_ptr_base<type> x(new type(args))\r
@@ -107,8 +102,6 @@ namespace stlplus
     //////////////////////////////////////////////////////////////////////////////\r
     // explicit function forms of the above assignment and dereference operators\r
 \r
-    // set the value - note that this does a copy using the C template parameter\r
-    void set_value(const T& data) throw(illegal_copy);\r
     // get the value\r
     T& value(void) throw(null_dereference);\r
     const T& value(void) const throw(null_dereference);\r
@@ -151,6 +144,14 @@ namespace stlplus
     // to copy the object with the right copy semantics. If the copy functor\r
     // is no_copy, an exception will be thrown.\r
 \r
+    // create a pointer containing a *copy* of the object using the template parameter C\r
+    // this copy is taken because the pointer class maintains a dynamically allocated object\r
+    // and the T& may not be (usually is not) dynamically allocated\r
+    explicit smart_ptr_base(const T& data) throw(illegal_copy);\r
+\r
+    // set the value - note that this does a copy using the C template parameter\r
+    void set_value(const T& data) throw(illegal_copy);\r
+\r
     // make this pointer unique with respect to any other references to the same object\r
     // if this pointer is already unique, it does nothing - otherwise it copies the object\r
     void make_unique(void) throw(illegal_copy);\r
@@ -207,9 +208,7 @@ namespace stlplus
   {\r
   public:\r
     smart_ptr_nocopy(void) {}\r
-    explicit smart_ptr_nocopy(const T& data) : smart_ptr_base<T, no_copy<T> >(data) {}\r
     explicit smart_ptr_nocopy(T* data) : smart_ptr_base<T, no_copy<T> >(data) {}\r
-    smart_ptr_nocopy<T>& operator=(const T& data) {set_value(data); return *this;}\r
     smart_ptr_nocopy<T>& operator=(T* data) {set(data); return *this;}\r
     ~smart_ptr_nocopy(void) {}\r
   };\r
This page took 0.024703 seconds and 4 git commands to generate.