]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix issues with #1573. 1576/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 17:07:50 +0000 (12:07 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 10 Sep 2015 17:07:50 +0000 (12:07 -0500)
Specifically, avoid an anonymous namespace in header files. Also
remove unnecessary specializations of functions for const input
arguments.

include/deal.II/base/tensor.h

index cf52223b035d0711a11d6f5602efe81675238b61..679909871a7a0577b1c6ea21d43506573f981d3b 100644 (file)
@@ -898,53 +898,26 @@ namespace internal
 {
   namespace TensorSubscriptor
   {
-    namespace
+    template <typename ArrayElementType, int dim>
+    ArrayElementType &
+    subscript (ArrayElementType *values,
+               const unsigned int i,
+               dealii::internal::int2type<dim>)
     {
-      template <typename ArrayElementType, int dim>
-      ArrayElementType &
-      subscript (ArrayElementType *values,
-                 const unsigned int i,
-                 dealii::internal::int2type<dim>)
-      {
-        Assert (i<dim, ExcIndexRange(i, 0, dim));
-        return values[i];
-      }
-
-
-      template <typename ArrayElementType, int dim>
-      const ArrayElementType &
-      subscript (const ArrayElementType *values,
-                 const unsigned int i,
-                 dealii::internal::int2type<dim>)
-      {
-        Assert (i<dim, ExcIndexRange(i, 0, dim));
-        return values[i];
-      }
-
-
-      template <typename ArrayElementType>
-      ArrayElementType &
-      subscript (ArrayElementType *,
-                 const unsigned int,
-                 dealii::internal::int2type<0>)
-      {
-        Assert(false, ExcMessage("Cannot access elements of an object of type Tensor<rank,0,Number>."));
-        static ArrayElementType t;
-        return t;
-      }
+      Assert (i<dim, ExcIndexRange(i, 0, dim));
+      return values[i];
+    }
 
 
-      template <typename ArrayElementType>
-      const ArrayElementType &
-      subscript (const ArrayElementType *,
-                 const unsigned int,
-                 dealii::internal::int2type<0>)
-      {
-        Assert(false, ExcMessage("Cannot access elements of an object of type Tensor<rank,0,Number>."));
-        static ArrayElementType t;
-        return t;
-      }
-
+    template <typename ArrayElementType>
+    ArrayElementType &
+    subscript (ArrayElementType *,
+               const unsigned int,
+               dealii::internal::int2type<0>)
+    {
+      Assert(false, ExcMessage("Cannot access elements of an object of type Tensor<rank,0,Number>."));
+      static ArrayElementType t;
+      return t;
     }
   }
 }

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.