Fixes #64: ("Add std::pair specializations for trivial type traits").

This commit is contained in:
Ion Gaztañaga
2026-02-16 22:42:48 +01:00
parent 932983f9b8
commit 13d52ab232
3 changed files with 94 additions and 0 deletions
+7
View File
@@ -802,6 +802,13 @@ Special thanks to:
[section:release_notes Release Notes]
[section:release_notes_boost_1_91 Boost 1.91 Release]
* Fixed bugs:
* [@https://github.com/boostorg/move/pull/64 Git Issue #64: ['"Add std::pair specializations for trivial type traits"]].
[endsect]
[section:release_notes_boost_1_90 Boost 1.90 Release]
* Fixed bugs:
+76
View File
@@ -1352,6 +1352,82 @@ struct aligned_storage
} //namespace move_detail {
} //namespace boost {
#include <boost/move/detail/std_ns_begin.hpp>
BOOST_MOVE_STD_NS_BEG
template<class T1, class T2>
struct pair;
BOOST_MOVE_STD_NS_END
#include <boost/move/detail/std_ns_end.hpp>
namespace boost {
namespace move_detail {
template<class A, class B>
struct is_trivially_copy_assignable<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_copy_assignable<A>::value &&
boost::move_detail::is_trivially_copy_assignable<B>::value;
};
template<class A, class B>
struct is_trivially_move_assignable<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_move_assignable<A>::value &&
boost::move_detail::is_trivially_move_assignable<B>::value;
};
template<class A, class B>
struct is_trivially_copy_constructible<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_copy_constructible<A>::value &&
boost::move_detail::is_trivially_copy_constructible<B>::value;
};
template<class A, class B>
struct is_trivially_move_constructible<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_move_constructible<A>::value &&
boost::move_detail::is_trivially_move_constructible<B>::value;
};
template<class A, class B>
struct is_trivially_destructible<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::move_detail::is_trivially_destructible<A>::value &&
boost::move_detail::is_trivially_destructible<B>::value;
};
template <class T1, class T2>
struct is_class< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
BOOST_STATIC_CONSTEXPR bool value = true;
};
template <class T1, class T2>
struct is_union< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
BOOST_STATIC_CONSTEXPR bool value = false;
};
template <class T1, class T2>
struct is_class_or_union< std::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
BOOST_STATIC_CONSTEXPR bool value = true;
};
} //namespace move_detail {
} //namespace boost {
#include <boost/move/detail/config_end.hpp>
#endif //#ifndef BOOST_MOVE_DETAIL_TYPE_TRAITS_HPP
+11
View File
@@ -57,6 +57,17 @@ struct has_nothrow_move
boost::move_detail::is_nothrow_move_assignable<T>::value;
};
#ifndef BOOST_MOVE_DOXYGEN_INVOKED
template<class A, class B>
struct has_trivial_destructor_after_move<std::pair<A,B> >
{
BOOST_STATIC_CONSTEXPR bool value = boost::has_trivial_destructor_after_move<A>::value &&
boost::has_trivial_destructor_after_move<B>::value;
};
#endif
namespace move_detail {
template <class T>