Index: boost/pending/container_traits.hpp =================================================================== --- boost/pending/container_traits.hpp (revision 60901) +++ boost/pending/container_traits.hpp (working copy) @@ -1,5 +1,6 @@ // (C) Copyright Jeremy Siek 2004 // (C) Copyright Thomas Claveirole 2010 +// (C) Copyright Ignacy Gawedzki 2010 // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -263,36 +264,60 @@ // hash_set, hash_map + struct unordered_set_tag : + virtual public simple_associative_container_tag, + virtual public unique_associative_container_tag + { }; + + struct unordered_multiset_tag : + virtual public simple_associative_container_tag, + virtual public multiple_associative_container_tag + { }; + + + struct unordered_map_tag : + virtual public pair_associative_container_tag, + virtual public unique_associative_container_tag + { }; + + struct unordered_multimap_tag : + virtual public pair_associative_container_tag, + virtual public multiple_associative_container_tag + { }; + + #ifndef BOOST_NO_HASH #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template struct container_traits< boost::unordered_set > { - typedef set_tag category; + typedef unordered_set_tag category; typedef unstable_tag iterator_stability; }; template struct container_traits< boost::unordered_map > { - typedef map_tag category; + typedef unordered_map_tag category; typedef unstable_tag iterator_stability; }; template struct container_traits< boost::unordered_multiset > { - typedef multiset_tag category; + typedef unordered_multiset_tag category; typedef unstable_tag iterator_stability; }; template struct container_traits< boost::unordered_multimap > { - typedef multimap_tag category; + typedef unordered_multimap_tag category; typedef unstable_tag iterator_stability; }; #endif template - set_tag container_category(const boost::unordered_set&) - { return set_tag(); } + unordered_set_tag + container_category(const boost::unordered_set&) + { return unordered_set_tag(); } template - map_tag container_category(const boost::unordered_map&) - { return map_tag(); } + unordered_map_tag + container_category(const boost::unordered_map&) + { return unordered_map_tag(); } template unstable_tag iterator_stability(const boost::unordered_set&) @@ -302,14 +327,14 @@ unstable_tag iterator_stability(const boost::unordered_map&) { return unstable_tag(); } template - multiset_tag + unordered_multiset_tag container_category(const boost::unordered_multiset&) - { return multiset_tag(); } + { return unordered_multiset_tag(); } template - multimap_tag + unordered_multimap_tag container_category(const boost::unordered_multimap&) - { return multimap_tag(); } + { return unordered_multimap_tag(); } template unstable_tag @@ -435,12 +460,11 @@ // Equal range template + class LessThanComparable> std::pair equal_range_dispatch(Container& c, const LessThanComparable& value, - const ContainerCategory&) + container_tag) { // c must be sorted for std::equal_range to behave properly. return std::equal_range(c.begin(), c.end(), value); @@ -451,7 +475,7 @@ typename AssociativeContainer::iterator> equal_range_dispatch(AssociativeContainer& c, const LessThanComparable& value, - const associative_container_tag&) + associative_container_tag) { return c.equal_range(value); }