From: Luca Heltai Date: Wed, 24 Apr 2019 11:27:19 +0000 (+0200) Subject: Added static_assert. X-Git-Tag: v9.1.0-rc1~180^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7932%2Fhead;p=dealii.git Added static_assert. --- diff --git a/include/deal.II/base/function_lib.h b/include/deal.II/base/function_lib.h index ab7635e89a..adca58384c 100644 --- a/include/deal.II/base/function_lib.h +++ b/include/deal.II/base/function_lib.h @@ -1654,6 +1654,11 @@ namespace Functions CutOffFunctionTensorProduct::set_base() { initialized = true; + static_assert( + std::is_base_of, CutOffFunctionBaseType<1>>::value, + "You can only construct a CutOffFunctionTensorProduct function from " + "a class derived from CutOffFunctionBase."); + for (unsigned int i = 0; i < dim; ++i) base[i].reset(new CutOffFunctionBaseType<1>(this->radius, Point<1>(this->center[i]),