From: Karl Ljungkvist Date: Tue, 22 Nov 2016 15:06:14 +0000 (+0100) Subject: Add more static asserts for sensible template parameters X-Git-Tag: v8.5.0-rc1~359^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760768824af9291854d1bf78c4e9e430832a0faf;p=dealii.git Add more static asserts for sensible template parameters --- diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 77732571df..5f54f94613 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -2721,6 +2721,14 @@ protected: friend class FEFaceValues; friend class FESubfaceValues; friend class FESystem; + + // explicitly check for sensible template arguments +#ifdef DEAL_II_WITH_CXX11 + static_assert (dim<=spacedim, + "The dimension of a FiniteElement must be less than or " + "equal to the space dimension in which it lives."); +#endif + }; diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 9ba7656484..096c6554d2 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -3454,6 +3454,14 @@ private: template friend class dealii::internal::Triangulation::TriaObjects; + + // explicitly check for sensible template arguments +#ifdef DEAL_II_WITH_CXX11 + static_assert (dim<=spacedim, + "The dimension of a Triangulation must be less than or " + "equal to the space dimension in which it lives."); +#endif + };