http://svn.boost.org/svn/boost/trunk graph/adjacency_list.hpp | 12 +++++++++++- graph/detail/adjacency_list.hpp | 37 +++++++++++++++++++++++++++++++++---- pending/container_traits.hpp | 31 ++++++++++++++++++++++++++++++- 3 files changed, 74 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,4 +1,4 @@ -// (C) Copyright Jeremy Siek 2004 +// (C) Copyright Jeremy Siek 2004, 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) @@ -274,6 +274,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 +300,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,6 +1,6 @@ // -*- c++ -*- //======================================================================= -// Copyright 1997, 1998, 1999, 2000 University of Notre Dame. +// Copyright 1997, 1998, 1999, 2000, 2010 University of Notre Dame. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // Distributed under the Boost Software License, Version 1.0. (See @@ -1633,6 +1633,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 @@ -1649,9 +1676,11 @@ 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)); + graph_detail::equal_range_dispatch(el, + StoredEdge(v, + fake_edge_container.end(), + &fake_edge_container), + 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,5 +1,5 @@ //======================================================================= -// Copyright 1997, 1998, 1999, 2000 University of Notre Dame. +// Copyright 1997, 1998, 1999, 2000, 2010 University of Notre Dame. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // Distributed under the Boost Software License, Version 1.0. (See @@ -254,6 +254,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};