diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index ed235b3c..e8fefe28 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -1044,13 +1044,7 @@ struct table_arrays arrays.groups(),groups_size, std::integral_constant< bool, -#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) - /* std::is_trivially_default_constructible not provided */ - std::is_default_constructible::value&& - std::has_trivial_default_constructor::value -#else - std::is_trivially_default_constructible::value -#endif + is_trivially_default_constructible::value >{}); arrays.groups()[groups_size-1].set_sentinel(); } @@ -2024,14 +2018,7 @@ private: x, std::integral_constant< bool, -#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) - /* std::is_trivially_copy_constructible not provided */ - std::is_copy_constructible::value&& - std::has_trivial_copy_constructor::value -#else - std::is_trivially_copy_constructible::value -#endif - &&( + is_trivially_copy_constructible::value&&( is_std_allocator::value|| !alloc_has_construct::value) >{} @@ -2074,13 +2061,7 @@ private: void copy_groups_array_from(const table_core& x) { copy_groups_array_from(x, std::integral_constant::value&& - std::has_trivial_copy_assign::value -#else - std::is_trivially_copy_assignable::value -#endif + is_trivially_copy_assignable::value >{} ); } diff --git a/include/boost/unordered/detail/type_traits.hpp b/include/boost/unordered/detail/type_traits.hpp index fcac2403..70bead23 100644 --- a/include/boost/unordered/detail/type_traits.hpp +++ b/include/boost/unordered/detail/type_traits.hpp @@ -11,6 +11,8 @@ #pragma once #endif +#include + #if !defined(BOOST_NO_CXX17_DEDUCTION_GUIDES) #include #endif @@ -46,6 +48,43 @@ namespace boost { template using void_t = typename make_void::type; +#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000) + /* std::is_trivially_default_constructible not provided */ + template struct is_trivially_default_constructible + { + constexpr static const bool value = + std::is_default_constructible::value && + std::has_trivial_default_constructor::value; + }; +#else + using std::is_trivially_default_constructible; +#endif + +#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000) + /* std::is_trivially_copy_constructible not provided */ + template struct is_trivially_copy_constructible + { + + constexpr static bool const value = + std::is_copy_constructible::value && + std::has_trivial_copy_constructor::value; + }; +#else + using std::is_trivially_copy_constructible; +#endif + +#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000) + /* std::is_trivially_copy_assignable not provided */ + template struct is_trivially_copy_assignable + { + constexpr static bool const value = + std::is_copy_assignable::value && + std::has_trivial_copy_assign::value; + }; +#else + using std::is_trivially_copy_assignable; +#endif + namespace type_traits_detail { using std::swap;