Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57560 - in trunk: boost/graph boost/graph/detail libs/graph/doc libs/graph/example libs/graph/test
From: jewillco_at_[hidden]
Date: 2009-11-10 21:59:27


Author: jewillco
Date: 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
New Revision: 57560
URL: http://svn.boost.org/trac/boost/changeset/57560

Log:
Changed to boost::unordered_* containers instead of compiler-specific ones; made hashed containers enabled always
Text files modified:
   trunk/boost/graph/adjacency_list.hpp | 39 +++++++++------------------------------
   trunk/boost/graph/detail/adjacency_list.hpp | 6 ++----
   trunk/boost/graph/labeled_graph.hpp | 3 +--
   trunk/libs/graph/doc/known_problems.html | 8 --------
   trunk/libs/graph/example/labeled_graph.cpp | 2 --
   trunk/libs/graph/test/adj_list_loops.cpp | 4 ----
   trunk/libs/graph/test/labeled_graph.cpp | 2 --
   trunk/libs/graph/test/subgraph_bundled.cpp | 4 ----
   trunk/libs/graph/test/subgraph_props.cpp | 4 ----
   trunk/libs/graph/test/test_graphs.cpp | 2 --
   10 files changed, 12 insertions(+), 62 deletions(-)

Modified: trunk/boost/graph/adjacency_list.hpp
==============================================================================
--- trunk/boost/graph/adjacency_list.hpp (original)
+++ trunk/boost/graph/adjacency_list.hpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -17,16 +17,7 @@
 #include <list>
 #include <set>
 
-// TODO: Deprecating this requires some cooperation from Boost.Config. It's not
-// a good idea to just refuse the inclusion because it could break otherwise
-// functioning code.
-#if !defined BOOST_NO_HASH
-# ifdef BOOST_HASH_SET_HEADER
-# include BOOST_HASH_SET_HEADER
-# else
-# include <hash_set>
-# endif
-#endif
+#include <boost/unordered_set.hpp>
 
 #if !defined BOOST_NO_SLIST
 # ifdef BOOST_SLIST_HEADER
@@ -73,12 +64,10 @@
   struct mapS { };
   struct multisetS { };
   struct multimapS { };
-#if !defined BOOST_NO_HASH
   struct hash_setS { };
   struct hash_mapS { };
   struct hash_multisetS { };
   struct hash_multimapS { };
-#endif
 
   template <class Selector, class ValueType>
   struct container_gen { };
@@ -118,27 +107,25 @@
     typedef std::multiset<ValueType> type;
   };
 
-#if !defined BOOST_NO_HASH
   template <class ValueType>
   struct container_gen<hash_setS, ValueType> {
- typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<ValueType> type;
+ typedef boost::unordered_set<ValueType> type;
   };
 
   template <class ValueType>
   struct container_gen<hash_mapS, ValueType> {
- typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<ValueType> type;
+ typedef boost::unordered_set<ValueType> type;
   };
 
   template <class ValueType>
   struct container_gen<hash_multisetS, ValueType> {
- typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<ValueType> type;
+ typedef boost::unordered_multiset<ValueType> type;
   };
 
   template <class ValueType>
   struct container_gen<hash_multimapS, ValueType> {
- typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<ValueType> type;
+ typedef boost::unordered_multiset<ValueType> type;
   };
-#endif
 
 #else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
@@ -180,27 +167,25 @@
     struct bind_ { typedef std::multiset<T, std::less<T> > type; };
   };
 
-#if !defined BOOST_NO_HASH
   struct hash_setS {
     template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<T, std::less<T> > type; };
+ struct bind_ { typedef boost::unordered_set<T> type; };
   };
 
   struct hash_mapS {
     template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<T, std::less<T> > type; };
+ struct bind_ { typedef boost::unordered_set<T> type; };
   };
 
   struct hash_multisetS {
     template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<T, std::less<T> > type; };
+ struct bind_ { typedef boost::unordered_multiset<T> type; };
   };
 
   struct hash_multimapS {
     template <class T>
- struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<T, std::less<T> > type; };
+ struct bind_ { typedef boost::unordered_multiset<T> type; };
   };
-#endif
 
   template <class Selector> struct container_selector {
     typedef vecS type;
@@ -216,9 +201,7 @@
   BOOST_CONTAINER_SELECTOR(mapS);
   BOOST_CONTAINER_SELECTOR(setS);
   BOOST_CONTAINER_SELECTOR(multisetS);
-#if !defined BOOST_NO_HASH
   BOOST_CONTAINER_SELECTOR(hash_mapS);
-#endif
 #if !defined BOOST_NO_SLIST
   BOOST_CONTAINER_SELECTOR(slistS);
 #endif
@@ -256,24 +239,20 @@
   struct parallel_edge_traits<multisetS> {
     typedef allow_parallel_edge_tag type; };
 
-#if !defined BOOST_NO_HASH
   template <>
   struct parallel_edge_traits<hash_setS> {
     typedef disallow_parallel_edge_tag type;
   };
-#endif
 
   // mapS is obsolete, replaced with setS
   template <>
   struct parallel_edge_traits<mapS> {
     typedef disallow_parallel_edge_tag type; };
 
-#if !defined BOOST_NO_HASH
   template <>
   struct parallel_edge_traits<hash_mapS> {
     typedef disallow_parallel_edge_tag type;
   };
-#endif
 
   namespace detail {
     template <class Directed> struct is_random_access {

Modified: trunk/boost/graph/detail/adjacency_list.hpp
==============================================================================
--- trunk/boost/graph/detail/adjacency_list.hpp (original)
+++ trunk/boost/graph/detail/adjacency_list.hpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -1183,13 +1183,11 @@
                                 multisetS*)
       { return edge_range(source(e, g), target(e, g), g); }
 
-#if !defined BOOST_NO_HASH
       std::pair<out_edge_iterator, out_edge_iterator>
       get_parallel_edge_sublist(typename Config::edge_descriptor e,
                                 const graph_type& g,
                                 hash_setS*)
       { return edge_range(source(e, g), target(e, g), g); }
-#endif
 
       // Placement of these overloaded remove_edge() functions
       // inside the class avoids a VC++ bug.
@@ -2785,8 +2783,8 @@
 
 } // namespace boost
 
-#if !defined(BOOST_NO_HASH) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-namespace BOOST_STD_EXTENSION_NAMESPACE {
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+namespace boost {
 
   #if BOOST_WORKAROUND( _STLPORT_VERSION, >= 0x500 )
   // STLport 5 already defines a hash<void*> specialization.

Modified: trunk/boost/graph/labeled_graph.hpp
==============================================================================
--- trunk/boost/graph/labeled_graph.hpp (original)
+++ trunk/boost/graph/labeled_graph.hpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -72,7 +72,6 @@
     struct generate_label_map<multimapS, Label, Vertex>
     { typedef std::multimap<Label, Vertex> type; };
 
-#if !defined BOOST_NO_HASH
     template <typename Label, typename Vertex>
     struct generate_label_map<hash_mapS, Label, Vertex>
     { typedef boost::unordered_map<Label, Vertex> type; };
@@ -80,7 +79,7 @@
     template <typename Label, typename Vertex>
     struct generate_label_map<hash_multimapS, Label, Vertex>
     { typedef boost::unordered_multimap<Label, Vertex> type; };
-#endif
+
     template <typename Selector, typename Label, typename Vertex>
     struct choose_custom_map {
         typedef typename generate_label_map<Selector, Label, Vertex>::type type;

Modified: trunk/libs/graph/doc/known_problems.html
==============================================================================
--- trunk/libs/graph/doc/known_problems.html (original)
+++ trunk/libs/graph/doc/known_problems.html 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -44,14 +44,6 @@
   <li>&quot;using boost::tie;&quot; may cause VC++ internal compiler error.
 </ol>
 
-<h2>Workarounds</h2>
-<p>
-<b>Compiler Warnings on <code>hash_set</code> and <code>hash_map</code></b>. Versions of
-GCC &gt;= 4.3 deprecate these headers and data structures and will emit warnings when
-compiling the BGL. To suppress these warnings <em>and the hash-based storage selectors</em>
-define the <code>BOOST_NO_HASH</code> prior to including any Boost.Graph headers.
-</p>
-
 <br>
 <HR>
 <TABLE>

Modified: trunk/libs/graph/example/labeled_graph.cpp
==============================================================================
--- trunk/libs/graph/example/labeled_graph.cpp (original)
+++ trunk/libs/graph/example/labeled_graph.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -7,8 +7,6 @@
 #include <iostream>
 #include <string>
 
-#define BOOST_NO_HASH
-
 #include <boost/graph/directed_graph.hpp>
 #include <boost/graph/labeled_graph.hpp>
 

Modified: trunk/libs/graph/test/adj_list_loops.cpp
==============================================================================
--- trunk/libs/graph/test/adj_list_loops.cpp (original)
+++ trunk/libs/graph/test/adj_list_loops.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -4,10 +4,6 @@
 // Boost Software License, Version 1.0 (See accompanying file
 // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 
-#if __GNUC__ == 4 && __GNUC_MINOR__ >= 3
-# define BOOST_NO_HASH
-#endif
-
 #include <iostream>
 
 #include <boost/assert.hpp>

Modified: trunk/libs/graph/test/labeled_graph.cpp
==============================================================================
--- trunk/libs/graph/test/labeled_graph.cpp (original)
+++ trunk/libs/graph/test/labeled_graph.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -8,8 +8,6 @@
 #include <string>
 #include <set>
 
-#define BOOST_NO_HASH
-
 #include <boost/assert.hpp>
 #include <boost/range.hpp>
 

Modified: trunk/libs/graph/test/subgraph_bundled.cpp
==============================================================================
--- trunk/libs/graph/test/subgraph_bundled.cpp (original)
+++ trunk/libs/graph/test/subgraph_bundled.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -8,10 +8,6 @@
 
 #include <boost/random/mersenne_twister.hpp>
 
-#if !defined(BOOST_NO_HASH)
-# define BOOST_NO_HASH
-#endif
-
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/subgraph.hpp>
 #include <boost/graph/random.hpp>

Modified: trunk/libs/graph/test/subgraph_props.cpp
==============================================================================
--- trunk/libs/graph/test/subgraph_props.cpp (original)
+++ trunk/libs/graph/test/subgraph_props.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -5,10 +5,6 @@
 
 #include <iostream>
 
-#if !defined(BOOST_NO_HASH)
-# define BOOST_NO_HASH
-#endif
-
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/subgraph.hpp>
 #include "typestr.hpp"

Modified: trunk/libs/graph/test/test_graphs.cpp
==============================================================================
--- trunk/libs/graph/test/test_graphs.cpp (original)
+++ trunk/libs/graph/test/test_graphs.cpp 2009-11-10 21:59:25 EST (Tue, 10 Nov 2009)
@@ -6,8 +6,6 @@
 
 #include <iostream>
 
-#define BOOST_NO_HASH
-
 #include "typestr.hpp"
 
 #include <boost/graph/adjacency_list.hpp>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk