]> https://gitweb.dealii.org/ - dealii.git/commitdiff
AffineConstraints: remove some reinterpret_casts. 17534/head
authorDavid Wells <drwells@email.unc.edu>
Wed, 14 Aug 2024 22:44:37 +0000 (16:44 -0600)
committerDavid Wells <drwells@email.unc.edu>
Thu, 15 Aug 2024 01:41:39 +0000 (19:41 -0600)
include/deal.II/lac/affine_constraints.templates.h

index 745326e4b20935c9677f2663fdd2ff2271d5a74f..f0edc5f0daa5aa3c466889abb15da8c12886111b 100644 (file)
@@ -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
     {

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.