]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix an 'unused typedef' warning. 14827/head
authorDavid Wells <drwells@email.unc.edu>
Sat, 25 Feb 2023 18:06:01 +0000 (13:06 -0500)
committerDavid Wells <drwells@email.unc.edu>
Sat, 25 Feb 2023 18:06:01 +0000 (13:06 -0500)
include/deal.II/matrix_free/operators.h

index b3e1f86d576d27fd5a0e10633221e436df7d3853..87ca185072aeed0409d312a0aeceb03f1e71b904 100644 (file)
@@ -1858,8 +1858,6 @@ namespace MatrixFreeOperators
                VectorType,
                VectorizedArrayType>::compute_diagonal()
   {
-    using Number =
-      typename Base<dim, VectorType, VectorizedArrayType>::value_type;
     Assert((Base<dim, VectorType, VectorizedArrayType>::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<dim, VectorType, VectorizedArrayType>::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);
       }

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.