Ticket #3972: unordered-adjacency_list.2.patch
File unordered-adjacency_list.2.patch, 5.6 KB (added by , 13 years ago) |
---|
-
boost/pending/container_traits.hpp
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, 73 insertions(+), 7 deletions(-)
1 // (C) Copyright Jeremy Siek 2004 1 // (C) Copyright Jeremy Siek 2004, 2010 2 2 // Distributed under the Boost Software License, Version 1.0. (See 3 3 // accompanying file LICENSE_1_0.txt or copy at 4 4 // http://www.boost.org/LICENSE_1_0.txt) … … 274 274 typedef map_tag category; 275 275 typedef stable_tag iterator_stability; // is this right? 276 276 }; 277 template <class Key, class Eq, class Hash, class Alloc> 278 struct container_traits< boost::unordered_multiset<Key,Eq,Hash,Alloc> > { 279 typedef multiset_tag category; 280 typedef stable_tag iterator_stability; // is this right? 281 }; 282 template <class Key, class T, class Eq, class Hash, class Alloc> 283 struct container_traits< boost::unordered_multimap<Key,T,Eq,Hash,Alloc> > { 284 typedef multimap_tag category; 285 typedef stable_tag iterator_stability; // is this right? 286 }; 277 287 #endif 278 288 template <class Key, class Eq, class Hash, class Alloc> 279 289 set_tag container_category(const boost::unordered_set<Key,Eq,Hash,Alloc>&) … … 290 300 template <class Key, class T, class Eq, class Hash, class Alloc> 291 301 stable_tag iterator_stability(const boost::unordered_map<Key,T,Eq,Hash,Alloc>&) 292 302 { return stable_tag(); } 303 template <class Key, class Eq, class Hash, class Alloc> 304 multiset_tag 305 container_category(const boost::unordered_multiset<Key,Eq,Hash,Alloc>&) 306 { return multiset_tag(); } 307 308 template <class Key, class T, class Eq, class Hash, class Alloc> 309 multimap_tag 310 container_category(const boost::unordered_multimap<Key,T,Eq,Hash,Alloc>&) 311 { return multimap_tag(); } 312 313 template <class Key, class Eq, class Hash, class Alloc> 314 stable_tag 315 iterator_stability(const boost::unordered_multiset<Key,Eq,Hash,Alloc>&) 316 { return stable_tag(); } 317 318 template <class Key, class T, class Eq, class Hash, class Alloc> 319 stable_tag 320 iterator_stability(const boost::unordered_multimap<Key,T,Eq,Hash,Alloc>&) 321 { return stable_tag(); } 293 322 #endif 294 323 295 324 -
boost/graph/detail/adjacency_list.hpp
1 1 // -*- c++ -*- 2 2 //======================================================================= 3 // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.3 // Copyright 1997, 1998, 1999, 2000, 2010 University of Notre Dame. 4 4 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek 5 5 // 6 6 // Distributed under the Boost Software License, Version 1.0. (See … … 1633 1633 const Graph& g = static_cast<const Graph&>(g_); 1634 1634 return g_.edge_dispatch(g, u, v, Cat()); 1635 1635 } 1636 1637 namespace graph_detail { 1638 1639 template <class Container, 1640 class LessThanComparable, 1641 class ContainerCategory> 1642 std::pair<typename Container::iterator, typename Container::iterator> 1643 equal_range_dispatch(Container& c, 1644 const LessThanComparable& value, 1645 const ContainerCategory&) 1646 { 1647 // c must be sorted for std::equal_range to behave properly. 1648 return std::equal_range(c.begin(), c.end(), value); 1649 } 1650 1651 template <class AssociativeContainer, class LessThanComparable> 1652 std::pair<typename AssociativeContainer::iterator, 1653 typename AssociativeContainer::iterator> 1654 equal_range_dispatch(AssociativeContainer& c, 1655 const LessThanComparable& value, 1656 const associative_container_tag&) 1657 { 1658 return c.equal_range(value); 1659 } 1660 1661 } // namespace graph_detail 1662 1636 1663 template <class Config, class Base> 1637 1664 inline std::pair<typename Config::out_edge_iterator, 1638 1665 typename Config::out_edge_iterator> … … 1648 1675 typename Config::OutEdgeList& el = g.out_edge_list(u); 1649 1676 typename Config::OutEdgeList::iterator first, last; 1650 1677 typename Config::EdgeContainer fake_edge_container; 1651 tie(first, last) = 1652 std::equal_range(el.begin(), el.end(),1653 StoredEdge(v, fake_edge_container.end(),1654 &fake_edge_container));1678 tie(first, last) = graph_detail:: 1679 equal_range_dispatch(el, StoredEdge(v, fake_edge_container.end(), 1680 &fake_edge_container), 1681 graph_detail::container_category(el)); 1655 1682 return std::make_pair(out_edge_iterator(first, u), 1656 1683 out_edge_iterator(last, u)); 1657 1684 } -
boost/graph/adjacency_list.hpp
1 1 //======================================================================= 2 // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.2 // Copyright 1997, 1998, 1999, 2000, 2010 University of Notre Dame. 3 3 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek 4 4 // 5 5 // Distributed under the Boost Software License, Version 1.0. (See … … 254 254 typedef disallow_parallel_edge_tag type; 255 255 }; 256 256 257 template <> 258 struct parallel_edge_traits<hash_multisetS> { 259 typedef allow_parallel_edge_tag type; 260 }; 261 262 template <> 263 struct parallel_edge_traits<hash_multimapS> { 264 typedef allow_parallel_edge_tag type; 265 }; 266 257 267 namespace detail { 258 268 template <class Directed> struct is_random_access { 259 269 enum { value = false};