]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get a few issues with constness right.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2005 22:06:00 +0000 (22:06 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2005 22:06:00 +0000 (22:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@10260 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/symmetric_tensor.h

index a96c8a70a8d02dd7d3d2e2fdb3876c0caac293c0..32bdce58ed22e21497a7e96939a6fec1b51b70bd 100644 (file)
@@ -110,7 +110,7 @@ namespace internal
                                             * access as well as the row we
                                             * point to as arguments.
                                             */
-          RowAccessor (const base_tensor_type  &tensor,
+          RowAccessor (base_tensor_type  &tensor,
                        const unsigned int  row);
 
                                            /**
@@ -120,14 +120,14 @@ namespace internal
                                             * of the element (in case this is
                                             * a constant tensor).
                                             */
-          reference operator[] (const unsigned int column) const;
+          reference operator[] (const unsigned int column);
           
         private:
                                            /**
                                             * Reference to the tensor we
                                             * access.
                                             */
-          const base_tensor_type &base_tensor;
+          base_tensor_type &base_tensor;
 
                                            /**
                                             * Index of the row we access.
@@ -374,7 +374,7 @@ namespace internal
     {
       template <int dim, bool constness>
       RowAccessor<dim,constness>::
-      RowAccessor (const base_tensor_type &base_tensor,
+      RowAccessor (base_tensor_type  &base_tensor,
                    const unsigned int row)
                       :
                       base_tensor (base_tensor),
@@ -388,7 +388,7 @@ namespace internal
       template <int dim, bool constness>
       typename RowAccessor<dim,constness>::reference
       RowAccessor<dim,constness>::
-      operator[] (const unsigned int column) const
+      operator[] (const unsigned int column)
       {
         Assert (column < dim, ExcIndexRange (column, 0, dim));
 
@@ -426,7 +426,8 @@ namespace internal
           }
 
         Assert (false, ExcInternalError());
-        return 0;
+        static double dummy_but_referenceable = 0;
+        return dummy_but_referenceable;
       }
     }
   }

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.