diff options
Diffstat (limited to 'boost/phoenix/stl')
-rw-r--r-- | boost/phoenix/stl/algorithm/detail/has_find.hpp | 10 | ||||
-rw-r--r-- | boost/phoenix/stl/algorithm/detail/is_unordered_set_or_map.hpp | 55 | ||||
-rw-r--r-- | boost/phoenix/stl/container/container.hpp | 68 | ||||
-rw-r--r-- | boost/phoenix/stl/container/detail/container.hpp | 20 |
4 files changed, 23 insertions, 130 deletions
diff --git a/boost/phoenix/stl/algorithm/detail/has_find.hpp b/boost/phoenix/stl/algorithm/detail/has_find.hpp index b089305bac..941a998797 100644 --- a/boost/phoenix/stl/algorithm/detail/has_find.hpp +++ b/boost/phoenix/stl/algorithm/detail/has_find.hpp @@ -22,6 +22,7 @@ #include "./is_std_set.hpp" #include "./is_std_hash_map.hpp" #include "./is_std_hash_set.hpp" +#include "./is_unordered_set_or_map.hpp" namespace boost { @@ -41,12 +42,15 @@ namespace boost , is_std_hash_set<T> , is_std_hash_multiset<T> > + , boost::mpl::or_< + is_std_unordered_map<T> + , is_std_unordered_multimap<T> + , is_std_unordered_set<T> + , is_std_unordered_multiset<T> + > > { }; } -// Bring in unordered_set and unordered_map stuff. -#include "./is_unordered_set_or_map.hpp" - #endif diff --git a/boost/phoenix/stl/algorithm/detail/is_unordered_set_or_map.hpp b/boost/phoenix/stl/algorithm/detail/is_unordered_set_or_map.hpp index 34d8230c55..5a4be127b5 100644 --- a/boost/phoenix/stl/algorithm/detail/is_unordered_set_or_map.hpp +++ b/boost/phoenix/stl/algorithm/detail/is_unordered_set_or_map.hpp @@ -23,8 +23,6 @@ #include <boost/mpl/bool.hpp> #include "./std_unordered_set_or_map_fwd.hpp" -#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP - namespace boost { template<class T> @@ -47,6 +45,8 @@ namespace boost : boost::mpl::false_ {}; +#ifdef BOOST_PHOENIX_HAS_UNORDERED_SET_AND_MAP + template< class Kty , class Hash @@ -89,56 +89,7 @@ namespace boost : boost::mpl::true_ {}; - template< - class Kty - , class Hash - , class Cmp - , class Alloc - > - struct has_find< std::unordered_set<Kty,Hash,Cmp,Alloc> > - : boost::mpl::true_ - { - }; - - template< - class Kty - , class Hash - , class Cmp - , class Alloc - > - struct has_find< std::unordered_multiset<Kty,Hash,Cmp,Alloc> > - : boost::mpl::true_ - { - }; - - template< - class Kty - , class Ty - , class Hash - , class Cmp - , class Alloc - > - struct has_find< std::unordered_map<Kty,Ty,Hash,Cmp,Alloc> > - : boost::mpl::true_ - { - }; - - template< - class Kty - , class Ty - , class Hash - , class Cmp - , class Alloc - > - struct has_find< std::unordered_multimap<Kty,Ty,Hash,Cmp,Alloc> > - : boost::mpl::true_ - { - }; - - -} - #endif - +} // namespace boost #endif diff --git a/boost/phoenix/stl/container/container.hpp b/boost/phoenix/stl/container/container.hpp index f9dbbdb048..907b0eb6cd 100644 --- a/boost/phoenix/stl/container/container.hpp +++ b/boost/phoenix/stl/container/container.hpp @@ -349,39 +349,19 @@ namespace boost { namespace phoenix {}; template <typename C, typename Arg1> - typename stl_impl::disable_if_is_void< - typename result_of::erase<C, Arg1>::type - >::type + typename result_of::erase<C, Arg1>::type operator()(C& c, Arg1 arg1) const { - return c.erase(arg1); - } - - template <typename C, typename Arg1> - typename stl_impl::enable_if_is_void< - typename result_of::erase<C, Arg1>::type - >::type - operator()(C& c, Arg1 arg1) const - { - c.erase(arg1); - } - - template <typename C, typename Arg1, typename Arg2> - typename stl_impl::disable_if_is_void< - typename result_of::erase<C, Arg1, Arg2>::type - >::type - operator()(C& c, Arg1 arg1, Arg2 arg2) const - { - return c.erase(arg1, arg2); + typedef typename result_of::erase<C, Arg1>::type result_type; + return static_cast<result_type>(c.erase(arg1)); } template <typename C, typename Arg1, typename Arg2> - typename stl_impl::enable_if_is_void< - typename result_of::erase<C, Arg1, Arg2>::type - >::type + typename result_of::erase<C, Arg1, Arg2>::type operator()(C& c, Arg1 arg1, Arg2 arg2) const { - c.erase(arg1, arg2); + typedef typename result_of::erase<C, Arg1, Arg2>::type result_type; + return static_cast<result_type>(c.erase(arg1, arg2)); } }; @@ -534,41 +514,19 @@ namespace boost { namespace phoenix } template <typename C, typename Arg1, typename Arg2> - typename stl_impl::disable_if_is_void< - typename result<insert(C&, Arg1, Arg2)>::type - >::type + typename result<insert(C&, Arg1, Arg2)>::type operator()(C& c, Arg1 arg1, Arg2 arg2) const { - return c.insert(arg1, arg2); - } - - template <typename C, typename Arg1, typename Arg2> - typename stl_impl::enable_if_is_void< - typename result<insert(C&, Arg1, Arg2)>::type - >::type - operator()(C& c, Arg1 arg1, Arg2 arg2) const - { - c.insert(arg1, arg2); - } - - template <typename C, typename Arg1, typename Arg2, typename Arg3> - typename stl_impl::disable_if_is_void< - typename result<insert(C&, Arg1, Arg2, Arg3)>::type - >::type - operator()( - C& c, Arg1 arg1, Arg2 arg2, Arg3 arg3) const - { - return c.insert(arg1, arg2, arg3); + typedef typename result<insert(C&, Arg1, Arg2)>::type result_type; + return static_cast<result_type>(c.insert(arg1, arg2)); } template <typename C, typename Arg1, typename Arg2, typename Arg3> - typename stl_impl::enable_if_is_void< - typename result<insert(C&, Arg1, Arg2, Arg3)>::type - >::type - operator()( - C& c, Arg1 arg1, Arg2 arg2, Arg3 arg3) const + typename result<insert(C&, Arg1, Arg2, Arg3)>::type + operator()(C& c, Arg1 arg1, Arg2 arg2, Arg3 arg3) const { - c.insert(arg1, arg2, arg3); + typedef typename result<insert(C&, Arg1, Arg2, Arg3)>::type result_type; + return static_cast<result_type>(c.insert(arg1, arg2, arg3)); } }; diff --git a/boost/phoenix/stl/container/detail/container.hpp b/boost/phoenix/stl/container/detail/container.hpp index bca98f43cb..fb6cad2fe9 100644 --- a/boost/phoenix/stl/container/detail/container.hpp +++ b/boost/phoenix/stl/container/detail/container.hpp @@ -124,26 +124,6 @@ namespace boost { namespace phoenix { namespace stl template <typename C> two has_mapped_type(...); - - template<typename T> - struct enable_if_is_void - {}; - - template<> - struct enable_if_is_void<void> - { - typedef void type; - }; - - template<typename T> - struct disable_if_is_void - { - typedef T type; - }; - - template<> - struct disable_if_is_void<void> - {}; } template <typename C> |