From 1e8d06d9faed1d749ba63af957fa3a765170fec8 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 7 Dec 2024 17:08:38 -0500 Subject: [PATCH] AlignedVector: use is_trivially_destructible. This is much more precise than std::is_trivial_v. --- include/deal.II/base/aligned_vector.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index 4d031a8e1e..633d8ee45f 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -1133,7 +1133,7 @@ AlignedVector::Deleter::operator()(T *ptr) Assert(owning_aligned_vector->used_elements_end != nullptr, ExcInternalError()); - if (std::is_trivial_v == false) + if (std::is_trivially_destructible_v == false) for (T *p = owning_aligned_vector->used_elements_end - 1; p >= ptr; --p) p->~T(); @@ -1190,7 +1190,7 @@ AlignedVector::Deleter::MPISharedMemDeleterAction::delete_array( // it, not unique_ptr) so it is still set to its correct value. if (is_shmem_root) - if (std::is_trivial_v == false) + if (std::is_trivially_destructible_v == false) for (T *p = aligned_vector->used_elements_end - 1; p >= ptr; --p) p->~T(); @@ -1345,7 +1345,7 @@ AlignedVector::resize_fast(const size_type new_size) // call destructor on fields that are released, if the type requires it. // doing it backward releases the elements in reverse order as compared to // how they were created - if (std::is_trivial_v == false) + if (std::is_trivially_destructible_v == false) for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p) p->~T(); used_elements_end = elements.get() + new_size; @@ -1382,7 +1382,7 @@ AlignedVector::resize(const size_type new_size) // call destructor on fields that are released, if the type requires it. // doing it backward releases the elements in reverse order as compared to // how they were created - if (std::is_trivial_v == false) + if (std::is_trivially_destructible_v == false) for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p) p->~T(); used_elements_end = elements.get() + new_size; @@ -1417,7 +1417,7 @@ AlignedVector::resize(const size_type new_size, const T &init) // call destructor on fields that are released, if the type requires it. // doing it backward releases the elements in reverse order as compared to // how they were created - if (std::is_trivial_v == false) + if (std::is_trivially_destructible_v == false) for (T *p = used_elements_end - 1; p >= elements.get() + new_size; --p) p->~T(); used_elements_end = elements.get() + new_size; -- 2.39.5