]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace a text description by a static_assert().
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 11 Jan 2020 22:35:05 +0000 (15:35 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Jan 2020 16:28:23 +0000 (09:28 -0700)
include/deal.II/numerics/data_out.h

index 0d57f5c5a03b40b3a134bb1001f1124e284a42bd..1abdaabeeb618a86ae9d4bef06d0a1b088f05ae4 100644 (file)
@@ -146,13 +146,6 @@ namespace internal
  * this pair of functions and they return a non-active cell, then an exception
  * will be thrown.
  *
- * @pre This class only makes sense if the first template argument,
- * <code>dim</code> equals the dimension of the DoFHandler type given as the
- * second template argument, i.e., if <code>dim ==
- * DoFHandlerType::dimension</code>. This redundancy is a historical relic
- * from the time where the library had only a single DoFHandler class and this
- * class consequently only a single template argument.
- *
  * @ingroup output
  * @author Wolfgang Bangerth, 1999
  */
@@ -162,6 +155,10 @@ class DataOut : public DataOut_DoFData<DoFHandlerType,
                                        DoFHandlerType::space_dimension>
 {
 public:
+  static_assert(dim == DoFHandlerType::dimension,
+                "The dimension given explicitly as a template argument to "
+                "this class must match the dimension of the DoFHandler "
+                "template argument");
   /**
    * Typedef to the iterator type of the dof handler class under
    * consideration.

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.