From c2783dd99bc4500721191be919d2f6d5df324314 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 11 Jan 2020 15:35:05 -0700 Subject: [PATCH] Replace a text description by a static_assert(). --- include/deal.II/numerics/data_out.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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. -- 2.39.5