]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Undo Ralfs patch.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2002 16:13:48 +0000 (16:13 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Sep 2002 16:13:48 +0000 (16:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@6531 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/table.h

index 268c11f5688f1cb05f845a99593fcc925e821817..b6bd7c72594a95c03897a5c302c719adcf90e7ad 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <base/config.h>
 #include <base/subscriptor.h>
-#include <base/smartpointer.h>
 
 #include <cstddef>
 #include <algorithm>
@@ -399,7 +398,7 @@ namespace TableBaseAccessors
                                         * no reason not to make these
                                         * elements constant.
                                         */
-      SmartPointer<const TableType> table;
+      const TableType &table;
       const pointer   data;
   };
 
@@ -503,7 +502,7 @@ namespace TableBaseAccessors
                                         * no reason not to make these
                                         * elements constant.
                                         */
-      SmartPointer<const TableType> table;
+      const TableType &table;
       const pointer   data;
   };
 };
@@ -1623,7 +1622,7 @@ namespace TableBaseAccessors
   Accessor<N,T,C,P>::Accessor (const TableType &table,
                                const pointer    data)
                   :
-                  table (&table),
+                  table (table),
                   data (data)
   {};
 
@@ -1634,24 +1633,24 @@ namespace TableBaseAccessors
   Accessor<N,T,C,P-1>
   Accessor<N,T,C,P>::operator [] (const unsigned int i) const 
   {
-    Assert (i < table->size()[N-P],
-            ExcIndexRange (i, 0, table->size()[N-P]));
+    Assert (i < table.size()[N-P],
+            ExcIndexRange (i, 0, table.size()[N-P]));
 
                                      // access i-th
                                      // subobject. optimize on the
                                      // case i==0
     if (i==0)
-      return Accessor<N,T,C,P-1> (*table, data);
+      return Accessor<N,T,C,P-1> (table, data);
     else 
       {
                                          // note: P>1, otherwise the
                                          // specialization would have
                                          // been taken!
-        unsigned int subobject_size = table->size()[N-1];
+        unsigned int subobject_size = table.size()[N-1];
         for (int p=P-1; p>1; --p)
-          subobject_size *= table->size()[N-p];
+          subobject_size *= table.size()[N-p];
         const pointer new_data = data + i*subobject_size;
-        return Accessor<N,T,C,P-1> (*table, new_data);
+        return Accessor<N,T,C,P-1> (table, new_data);
       };
   };
 
@@ -1662,7 +1661,7 @@ namespace TableBaseAccessors
   Accessor<N,T,C,1>::Accessor (const TableType &table,
                                const pointer    data)
                   :
-                  table (&table),
+                  table (table),
                   data (data)
   {};
 
@@ -1673,8 +1672,8 @@ namespace TableBaseAccessors
   typename Accessor<N,T,C,1>::reference
   Accessor<N,T,C,1>::operator [] (const unsigned int i) const 
   {
-    Assert (i < table->size()[N-1],
-            ExcIndexRange (i, 0, table->size()[N-1]));
+    Assert (i < table.size()[N-1],
+            ExcIndexRange (i, 0, table.size()[N-1]));
     return data[i];
   };
 
@@ -1685,7 +1684,7 @@ namespace TableBaseAccessors
   unsigned int
   Accessor<N,T,C,1>::size () const
   {
-    return table->size()[N-1];
+    return table.size()[N-1];
   };
 
 
@@ -1705,7 +1704,7 @@ namespace TableBaseAccessors
   typename Accessor<N,T,C,1>::iterator
   Accessor<N,T,C,1>::end () const
   {
-    return data+table->size()[N-1];
+    return data+table.size()[N-1];
   };
 };
 

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.