]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid another incorrect use of std::is_trivial. 17937/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Dec 2024 03:38:59 +0000 (20:38 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 18 Dec 2024 03:38:59 +0000 (20:38 -0700)
source/base/vectorization.cc

index 24982dad50fabc3ccbeab4b7626c3d580d493dce..9526306fc0c58ea35a415b82c8f7198a0a53b9f4 100644 (file)
@@ -22,11 +22,18 @@ DEAL_II_NAMESPACE_OPEN
 // and it is trivial (can be statically default initialized)
 // Here, the trait std::is_pod cannot be used because it is deprecated
 // in C++20.
-static_assert(std::is_standard_layout_v<VectorizedArray<double>> &&
-                std::is_trivial_v<VectorizedArray<double>>,
-              "VectorizedArray<double> must be a POD type");
-static_assert(std::is_standard_layout_v<VectorizedArray<float>> &&
-                std::is_trivial_v<VectorizedArray<float>>,
-              "VectorizedArray<float> must be a POD type");
+//
+// Check these statements to ensure we catch problems if we accidentally
+// make these classes non-POD.
+static_assert(
+  std::is_standard_layout_v<VectorizedArray<double>> &&
+    std::is_trivially_default_constructible_v<VectorizedArray<double>> &&
+    std::is_trivially_copyable_v<VectorizedArray<double>>,
+  "VectorizedArray<double> must be a POD type");
+static_assert(
+  std::is_standard_layout_v<VectorizedArray<float>> &&
+    std::is_trivially_default_constructible_v<VectorizedArray<float>> &&
+    std::is_trivially_copyable_v<VectorizedArray<float>>,
+  "VectorizedArray<float> must be a POD type");
 
 DEAL_II_NAMESPACE_CLOSE

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.