From 694b253086b7595bd22048c52d3908c9d41e43b7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 22:14:19 +0300 Subject: [PATCH] Use std::is_trivially_copyable instead of is_trivially_copy_constructible + is_trivially_destructible --- include/boost/function/function_template.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 07cf992..48329c2 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -601,13 +601,12 @@ namespace boost { #if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000 - template struct is_trivially_copy_constructible: std::integral_constant::value && std::has_trivial_copy_constructor::value> - { - }; + template struct is_trivially_copyable: std::integral_constant {}; #else - using std::is_trivially_copy_constructible; + using std::is_trivially_copyable; #endif @@ -846,8 +845,7 @@ namespace boost { if (stored_vtable.assign_to(std::move(f), functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::detail::function::is_trivially_copy_constructible::value && - std::is_trivially_destructible::value && + if (boost::detail::function::is_trivially_copyable::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); @@ -880,8 +878,7 @@ namespace boost { if (stored_vtable.assign_to_a(std::move(f), functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::detail::function::is_trivially_copy_constructible::value && - std::is_trivially_destructible::value && + if (boost::detail::function::is_trivially_copyable::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value);