Add more is_class, is_class_or_union, is_enum specialization to pair to allow recursive containers and type traits intrinsics

This commit is contained in:
Ion Gaztañaga
2016-06-25 11:04:55 +02:00
parent a52684beea
commit 153fd7f474

View File

@@ -283,6 +283,12 @@ struct is_enum< ::boost::container::container_detail::pair<T, U> >
static const bool value = false;
};
template<class T, class U>
struct is_enum< ::std::pair<T, U> >
{
static const bool value = false;
};
template <class T>
struct is_class;
@@ -325,8 +331,43 @@ struct is_class_or_union< std::pair<T1, T2> >
static const bool value = true;
};
template<class T>
struct is_union;
template <class T1, class T2>
struct is_union< ::boost::container::container_detail::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
static const bool value = false;
};
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.
{
static const bool value = false;
};
template<class T>
struct is_class;
template <class T1, class T2>
struct is_class< ::boost::container::container_detail::pair<T1, T2> >
//This specialization is needed to avoid instantiation of pair in
//is_class, and allow recursive maps.
{
static const bool value = true;
};
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.
{
static const bool value = true;
};
} //namespace move_detail{