From 153fd7f474861eb0196d2a5e8e10f4c8627b99fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 25 Jun 2016 11:04:55 +0200 Subject: [PATCH] Add more is_class, is_class_or_union, is_enum specialization to pair to allow recursive containers and type traits intrinsics --- include/boost/container/detail/pair.hpp | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/include/boost/container/detail/pair.hpp b/include/boost/container/detail/pair.hpp index 134760e..f239b69 100644 --- a/include/boost/container/detail/pair.hpp +++ b/include/boost/container/detail/pair.hpp @@ -283,6 +283,12 @@ struct is_enum< ::boost::container::container_detail::pair > static const bool value = false; }; +template +struct is_enum< ::std::pair > +{ + static const bool value = false; +}; + template struct is_class; @@ -325,8 +331,43 @@ struct is_class_or_union< std::pair > static const bool value = true; }; +template +struct is_union; +template +struct is_union< ::boost::container::container_detail::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = false; +}; +template +struct is_union< std::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = false; +}; + +template +struct is_class; + +template +struct is_class< ::boost::container::container_detail::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = true; +}; + +template +struct is_class< std::pair > +//This specialization is needed to avoid instantiation of pair in +//is_class, and allow recursive maps. +{ + static const bool value = true; +}; } //namespace move_detail{