]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added static_assert. 7932/head
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 24 Apr 2019 11:27:19 +0000 (13:27 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 24 Apr 2019 11:27:19 +0000 (13:27 +0200)
include/deal.II/base/function_lib.h

index ab7635e89aa265e066086d45fd307b9e7561468c..adca58384c393e0abf506e29ebd5e18cd5c8c714 100644 (file)
@@ -1654,6 +1654,11 @@ namespace Functions
   CutOffFunctionTensorProduct<dim>::set_base()
   {
     initialized = true;
+    static_assert(
+      std::is_base_of<CutOffFunctionBase<1>, 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]),

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.