]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add #const# and add documentation.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 3 Sep 1998 16:01:47 +0000 (16:01 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 3 Sep 1998 16:01:47 +0000 (16:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@552 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/subscriptor.h

index 588bb2728b04a5c22b25e8cc1d1e4d9ff2697c92..5592ee007f888262e50ffda2a56631ffe5e38a50 100644 (file)
@@ -27,6 +27,9 @@ class Subscriptor
                                      * destruction it shall be zero again
                                      * (i.e. all objects which subscribed
                                      * should have unsubscribed again).
+                                     *
+                                     * The creator (and owner) of an object
+                                     * is not counted.
                                      */
     mutable unsigned int counter;
   public:
@@ -127,7 +130,7 @@ class SmartReference
                                     /**
                                      * Conversion to normal reference
                                      */
-    operator T& ()
+    operator T& () const
       {
        return t;
       }
@@ -137,7 +140,12 @@ class SmartReference
 
 
 /**
- * Smart pointers avoid destruction of an object in use.
+ * Smart pointers avoid destruction of an object in use. They can be used just
+ * like a pointer (i.e. using the #*# and #-># operators and through casting)
+ * but make sure that the object pointed to is not deleted in the course of
+ * use of the pointer by signalling the pointee its use. This is done using
+ * the #Subscriptor# class, which handles a use count and refuses destruction
+ * as long as a smart pointer or reference uses that object.
  */
 template<class T>
 class SmartPointer

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.