Pull triviality type traits into internal type_traits header

This commit is contained in:
Christian Mazakas
2023-09-28 21:12:04 -07:00
parent a0e1bc295a
commit 47fa9cd17e
2 changed files with 42 additions and 22 deletions

View File

@ -1044,13 +1044,7 @@ struct table_arrays
arrays.groups(),groups_size, arrays.groups(),groups_size,
std::integral_constant< std::integral_constant<
bool, bool,
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) is_trivially_default_constructible<group_type>::value
/* std::is_trivially_default_constructible not provided */
std::is_default_constructible<group_type>::value&&
std::has_trivial_default_constructor<group_type>::value
#else
std::is_trivially_default_constructible<group_type>::value
#endif
>{}); >{});
arrays.groups()[groups_size-1].set_sentinel(); arrays.groups()[groups_size-1].set_sentinel();
} }
@ -2024,14 +2018,7 @@ private:
x, x,
std::integral_constant< std::integral_constant<
bool, bool,
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) is_trivially_copy_constructible<element_type>::value&&(
/* std::is_trivially_copy_constructible not provided */
std::is_copy_constructible<element_type>::value&&
std::has_trivial_copy_constructor<element_type>::value
#else
std::is_trivially_copy_constructible<element_type>::value
#endif
&&(
is_std_allocator<Allocator>::value|| is_std_allocator<Allocator>::value||
!alloc_has_construct<Allocator,value_type*,const value_type&>::value) !alloc_has_construct<Allocator,value_type*,const value_type&>::value)
>{} >{}
@ -2074,13 +2061,7 @@ private:
void copy_groups_array_from(const table_core& x) { void copy_groups_array_from(const table_core& x) {
copy_groups_array_from(x, std::integral_constant<bool, copy_groups_array_from(x, std::integral_constant<bool,
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) is_trivially_copy_assignable<group_type>::value
/* std::is_trivially_copy_assignable not provided */
std::is_copy_assignable<group_type>::value&&
std::has_trivial_copy_assign<group_type>::value
#else
std::is_trivially_copy_assignable<group_type>::value
#endif
>{} >{}
); );
} }

View File

@ -11,6 +11,8 @@
#pragma once #pragma once
#endif #endif
#include <boost/config/workaround.hpp>
#if !defined(BOOST_NO_CXX17_DEDUCTION_GUIDES) #if !defined(BOOST_NO_CXX17_DEDUCTION_GUIDES)
#include <iterator> #include <iterator>
#endif #endif
@ -46,6 +48,43 @@ namespace boost {
template <typename... Ts> using void_t = typename make_void<Ts...>::type; template <typename... Ts> using void_t = typename make_void<Ts...>::type;
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
/* std::is_trivially_default_constructible not provided */
template <class T> struct is_trivially_default_constructible
{
constexpr static const bool value =
std::is_default_constructible<T>::value &&
std::has_trivial_default_constructor<T>::value;
};
#else
using std::is_trivially_default_constructible;
#endif
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
/* std::is_trivially_copy_constructible not provided */
template <class T> struct is_trivially_copy_constructible
{
constexpr static bool const value =
std::is_copy_constructible<T>::value &&
std::has_trivial_copy_constructor<T>::value;
};
#else
using std::is_trivially_copy_constructible;
#endif
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION, < 50000)
/* std::is_trivially_copy_assignable not provided */
template <class T> struct is_trivially_copy_assignable
{
constexpr static bool const value =
std::is_copy_assignable<T>::value &&
std::has_trivial_copy_assign<T>::value;
};
#else
using std::is_trivially_copy_assignable;
#endif
namespace type_traits_detail { namespace type_traits_detail {
using std::swap; using std::swap;