From: David Wells Date: Sat, 25 Feb 2023 18:06:01 +0000 (-0500) Subject: Fix an 'unused typedef' warning. X-Git-Tag: v9.5.0-rc1~524^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cd5f88f34bbe2e07162ac3a0d63de607e5f1684;p=dealii.git Fix an 'unused typedef' warning. --- diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index b3e1f86d57..87ca185072 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -1858,8 +1858,6 @@ namespace MatrixFreeOperators VectorType, VectorizedArrayType>::compute_diagonal() { - using Number = - typename Base::value_type; Assert((Base::data.get() != nullptr), ExcNotInitialized()); Assert(this->selected_rows == this->selected_columns, @@ -1912,8 +1910,13 @@ namespace MatrixFreeOperators for (unsigned int i = 0; i < inverse_diagonal_vector.locally_owned_size(); ++i) { +#ifdef DEBUG + // only define the type alias in debug mode to avoid a warning + using Number = + typename Base::value_type; Assert(diagonal_vector.local_element(i) > Number(0), ExcInternalError()); +#endif inverse_diagonal_vector.local_element(i) = 1. / inverse_diagonal_vector.local_element(i); }