From de74f9791c0326cb5eb1c1e7295fe4a347cf7c86 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 23 May 2022 23:06:04 +0200 Subject: [PATCH] Fix compilation of Utilities::pack with std::vector --- include/deal.II/base/utilities.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 92b3df3cd8..9ff8ff10eb 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -1233,16 +1233,16 @@ namespace Utilities template struct IsVectorOfTriviallyCopyable> { - static constexpr bool value = std::is_trivially_copyable::value; + static constexpr bool value = + std::is_trivially_copyable::value && !std::is_same::value; }; /** - * A function that is used to append the contents of a - * std::vector (where T is a type that - * satisfies std::is_trivially_copyable::value == true) - * bit for bit to a character array. + * A function that is used to append the contents of a std::vector + * (where T is a type that satisfies std::is_trivially_copyable::value + * == true but not T==bool) bit for bit to a character array. * * If the type is not such a vector of T, then the function * throws an exception. @@ -1258,7 +1258,8 @@ namespace Utilities template ::value>> + typename = std::enable_if_t::value && + std::is_trivially_copyable::value>> inline void append_vector_of_trivially_copyable_to_buffer( const std::vector &object, @@ -1296,7 +1297,8 @@ namespace Utilities template ::value>> + typename = std::enable_if_t::value && + std::is_trivially_copyable::value>> inline void create_vector_of_trivially_copyable_from_buffer( const std::vector::const_iterator &cbegin, -- 2.39.5