http://svn.boost.org/svn/boost/trunk graph/adjacency_list.hpp | 13 ++++++++++++- graph/detail/adjacency_list.hpp | 38 +++++++++++++++++++++++++++++++++----- pending/container_traits.hpp | 30 ++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 6 deletions(-) Index: boost/pending/container_traits.hpp --- boost/pending/container_traits.hpp (révision 60096) +++ boost/pending/container_traits.hpp (copie de travail) @@ -1,3 +1,4 @@ +// (C) Copyright Thomas Claveirole 2010 // (C) Copyright Jeremy Siek 2004 // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -274,6 +275,16 @@ typedef map_tag category; typedef stable_tag iterator_stability; // is this right? }; + template + struct container_traits< boost::unordered_multiset > { + typedef multiset_tag category; + typedef stable_tag iterator_stability; // is this right? + }; + template + struct container_traits< boost::unordered_multimap > { + typedef multimap_tag category; + typedef stable_tag iterator_stability; // is this right? + }; #endif template set_tag container_category(const boost::unordered_set&) @@ -290,6 +301,25 @@ template stable_tag iterator_stability(const boost::unordered_map&) { return stable_tag(); } + template + multiset_tag + container_category(const boost::unordered_multiset&) + { return multiset_tag(); } + + template + multimap_tag + container_category(const boost::unordered_multimap&) + { return multimap_tag(); } + + template + stable_tag + iterator_stability(const boost::unordered_multiset&) + { return stable_tag(); } + + template + stable_tag + iterator_stability(const boost::unordered_multimap&) + { return stable_tag(); } #endif Index: boost/graph/detail/adjacency_list.hpp --- boost/graph/detail/adjacency_list.hpp (révision 60096) +++ boost/graph/detail/adjacency_list.hpp (copie de travail) @@ -1,7 +1,8 @@ // -*- c++ -*- //======================================================================= +// Copyright 2010 Thomas Claveirole // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. -// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -1633,6 +1634,33 @@ const Graph& g = static_cast(g_); return g_.edge_dispatch(g, u, v, Cat()); } + + namespace graph_detail { + + template + std::pair + equal_range_dispatch(Container& c, + const LessThanComparable& value, + const ContainerCategory&) + { + // c must be sorted for std::equal_range to behave properly. + return std::equal_range(c.begin(), c.end(), value); + } + + template + std::pair + equal_range_dispatch(AssociativeContainer& c, + const LessThanComparable& value, + const associative_container_tag&) + { + return c.equal_range(value); + } + + } // namespace graph_detail + template inline std::pair @@ -1648,10 +1676,10 @@ typename Config::OutEdgeList& el = g.out_edge_list(u); typename Config::OutEdgeList::iterator first, last; typename Config::EdgeContainer fake_edge_container; - tie(first, last) = - std::equal_range(el.begin(), el.end(), - StoredEdge(v, fake_edge_container.end(), - &fake_edge_container)); + tie(first, last) = graph_detail:: + equal_range_dispatch(el, StoredEdge(v, fake_edge_container.end(), + &fake_edge_container), + graph_detail::container_category(el)); return std::make_pair(out_edge_iterator(first, u), out_edge_iterator(last, u)); } Index: boost/graph/adjacency_list.hpp --- boost/graph/adjacency_list.hpp (révision 60096) +++ boost/graph/adjacency_list.hpp (copie de travail) @@ -1,6 +1,7 @@ //======================================================================= +// Copyright 2010 Thomas Claveirole // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. -// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -254,6 +255,16 @@ typedef disallow_parallel_edge_tag type; }; + template <> + struct parallel_edge_traits { + typedef allow_parallel_edge_tag type; + }; + + template <> + struct parallel_edge_traits { + typedef allow_parallel_edge_tag type; + }; + namespace detail { template struct is_random_access { enum { value = false};