]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid the final incorrect use of std::is_trivial. 17938/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Dec 2024 03:43:05 +0000 (20:43 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Dec 2024 03:43:05 +0000 (20:43 -0700)
include/deal.II/lac/vector_operations_internal.h

index cdbeacc2235a62d8231b844fd58f0da3771941cd..a59e9d93544cd3842b4c251e556281ce4b595cbd 100644 (file)
@@ -210,14 +210,9 @@ namespace internal
         Assert(end >= begin, ExcInternalError());
 
         if (value == Number())
-          {
-            if constexpr (std::is_trivial_v<Number>)
-              {
-                std::memset(dst + begin, 0, sizeof(Number) * (end - begin));
-                return;
-              }
-          }
-        std::fill(dst + begin, dst + end, value);
+          std::fill(dst + begin, dst + end, Number());
+        else
+          std::fill(dst + begin, dst + end, value);
       }
 
       const Number  value;

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.