From: Wolfgang Bangerth Date: Thu, 10 Sep 2015 17:07:50 +0000 (-0500) Subject: Fix issues with #1573. X-Git-Tag: v8.4.0-rc2~444^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35465761e3cb099570d190c1c3ac0717f0272499;p=dealii.git Fix issues with #1573. Specifically, avoid an anonymous namespace in header files. Also remove unnecessary specializations of functions for const input arguments. --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index cf52223b03..679909871a 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -898,53 +898,26 @@ namespace internal { namespace TensorSubscriptor { - namespace + template + ArrayElementType & + subscript (ArrayElementType *values, + const unsigned int i, + dealii::internal::int2type) { - template - ArrayElementType & - subscript (ArrayElementType *values, - const unsigned int i, - dealii::internal::int2type) - { - Assert (i - const ArrayElementType & - subscript (const ArrayElementType *values, - const unsigned int i, - dealii::internal::int2type) - { - Assert (i - ArrayElementType & - subscript (ArrayElementType *, - const unsigned int, - dealii::internal::int2type<0>) - { - Assert(false, ExcMessage("Cannot access elements of an object of type Tensor.")); - static ArrayElementType t; - return t; - } + Assert (i - const ArrayElementType & - subscript (const ArrayElementType *, - const unsigned int, - dealii::internal::int2type<0>) - { - Assert(false, ExcMessage("Cannot access elements of an object of type Tensor.")); - static ArrayElementType t; - return t; - } - + template + ArrayElementType & + subscript (ArrayElementType *, + const unsigned int, + dealii::internal::int2type<0>) + { + Assert(false, ExcMessage("Cannot access elements of an object of type Tensor.")); + static ArrayElementType t; + return t; } } }