From: Wolfgang Bangerth Date: Wed, 18 Dec 2024 03:38:59 +0000 (-0700) Subject: Avoid another incorrect use of std::is_trivial. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17937%2Fhead;p=dealii.git Avoid another incorrect use of std::is_trivial. --- diff --git a/source/base/vectorization.cc b/source/base/vectorization.cc index 24982dad50..9526306fc0 100644 --- a/source/base/vectorization.cc +++ b/source/base/vectorization.cc @@ -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> && - std::is_trivial_v>, - "VectorizedArray must be a POD type"); -static_assert(std::is_standard_layout_v> && - std::is_trivial_v>, - "VectorizedArray 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> && + std::is_trivially_default_constructible_v> && + std::is_trivially_copyable_v>, + "VectorizedArray must be a POD type"); +static_assert( + std::is_standard_layout_v> && + std::is_trivially_default_constructible_v> && + std::is_trivially_copyable_v>, + "VectorizedArray must be a POD type"); DEAL_II_NAMESPACE_CLOSE