From: Matthias Maier Date: Thu, 17 Sep 2015 17:47:54 +0000 (-0500) Subject: Convert static_assert to Assert X-Git-Tag: v8.4.0-rc2~385^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edfbf831a77820fcb37f8c418f3d7c1c0c6ef861;p=dealii.git Convert static_assert to Assert --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index fe219184cb..931377dc2e 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1515,12 +1515,11 @@ typename Tensor &src1, const Tensor &src2) { -#ifdef DEAL_II_WITH_CXX11 - static_assert(0 <= index_1 && index_1 < rank_1, - "The specified index_1 must lie within the range [0,rank_1)"); - static_assert(0 <= index_2 && index_2 < rank_2, - "The specified index_2 must lie within the range [0,rank_2)"); -#endif + Assert(0 <= index_1 && index_1 < rank_1, + ExcMessage("The specified index_1 must lie within the range [0,rank_1)")); + Assert(0 <= index_2 && index_2 < rank_2, + ExcMessage("The specified index_2 must lie within the range [0,rank_2)")); + using namespace TensorAccessors; using namespace TensorAccessors::internal; @@ -1579,16 +1578,19 @@ typename Tensor &src1, const Tensor &src2) { -#ifdef DEAL_II_WITH_CXX11 - static_assert(0 <= index_1 && index_1 < rank_1, - "The specified index_1 must lie within the range [0,rank_1)"); - static_assert(0 <= index_3 && index_3 < rank_1, - "The specified index_3 must lie within the range [0,rank_1)"); - static_assert(0 <= index_2 && index_2 < rank_2, - "The specified index_2 must lie within the range [0,rank_2)"); - static_assert(0 <= index_4 && index_4 < rank_2, - "The specified index_4 must lie within the range [0,rank_2)"); -#endif + Assert(0 <= index_1 && index_1 < rank_1, + ExcMessage("The specified index_1 must lie within the range [0,rank_1)")); + Assert(0 <= index_3 && index_3 < rank_1, + ExcMessage("The specified index_3 must lie within the range [0,rank_1)")); + Assert(index_1 != index_3, + ExcMessage("index_1 and index_3 must not be the same")); + Assert(0 <= index_2 && index_2 < rank_2, + ExcMessage("The specified index_2 must lie within the range [0,rank_2)")); + Assert(0 <= index_4 && index_4 < rank_2, + ExcMessage("The specified index_4 must lie within the range [0,rank_2)")); + Assert(index_2 != index_4, + ExcMessage("index_2 and index_4 must not be the same")); + using namespace TensorAccessors; using namespace TensorAccessors::internal;