From: David Wells <drwells@email.unc.edu>
Date: Wed, 14 Aug 2024 22:44:37 +0000 (-0600)
Subject: AffineConstraints: remove some reinterpret_casts.
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4317b239af409a23f878eea24e035f71e0a80f5b;p=dealii.git

AffineConstraints: remove some reinterpret_casts.
---

diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h
index 745326e4b2..f0edc5f0da 100644
--- a/include/deal.II/lac/affine_constraints.templates.h
+++ b/include/deal.II/lac/affine_constraints.templates.h
@@ -4511,11 +4511,9 @@ AffineConstraints<number>::distribute_local_to_global(
   // add must be equal if we have a Trilinos or PETSc vector but do not have to
   // be if we have a deal.II native vector: one could further optimize this for
   // Vector, LinearAlgebra::distributed::vector, etc.
-  if (std::is_same_v<typename VectorType::value_type, number>)
+  if constexpr (std::is_same_v<typename VectorType::value_type, number>)
     {
-      global_vector.add(vector_indices,
-                        *reinterpret_cast<std::vector<number> *>(
-                          &vector_values));
+      global_vector.add(vector_indices, vector_values);
     }
   else
     {