From: Wolfgang Bangerth Date: Sat, 11 Jan 2020 22:35:05 +0000 (-0700) Subject: Replace a text description by a static_assert(). X-Git-Tag: v9.2.0-rc1~657^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2783dd99bc4500721191be919d2f6d5df324314;p=dealii.git Replace a text description by a static_assert(). --- diff --git a/include/deal.II/numerics/data_out.h b/include/deal.II/numerics/data_out.h index 0d57f5c5a0..1abdaabeeb 100644 --- a/include/deal.II/numerics/data_out.h +++ b/include/deal.II/numerics/data_out.h @@ -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, - * dim equals the dimension of the DoFHandler type given as the - * second template argument, i.e., if dim == - * DoFHandlerType::dimension. 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 { 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.