From: Martin Kronbichler Date: Mon, 23 May 2022 21:06:04 +0000 (+0200) Subject: Fix compilation of Utilities::pack with std::vector X-Git-Tag: v9.4.0-rc1~166^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13799%2Fhead;p=dealii.git Fix compilation of Utilities::pack with std::vector --- 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,