Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49554 - trunk/boost/graph
From: asutton_at_[hidden]
Date: 2008-11-03 10:03:14


Author: asutton
Date: 2008-11-03 10:03:13 EST (Mon, 03 Nov 2008)
New Revision: 49554
URL: http://svn.boost.org/trac/boost/changeset/49554

Log:
Added a compiler check to adjacency_list.hpp that checks for GCC >= 4.3 and
defines BOOST_NO_HASH. Closes #2444.

Text files modified:
   trunk/boost/graph/adjacency_list.hpp | 58 ++++++++++++++++++++++-----------------
   1 files changed, 32 insertions(+), 26 deletions(-)

Modified: trunk/boost/graph/adjacency_list.hpp
==============================================================================
--- trunk/boost/graph/adjacency_list.hpp (original)
+++ trunk/boost/graph/adjacency_list.hpp 2008-11-03 10:03:13 EST (Mon, 03 Nov 2008)
@@ -17,6 +17,12 @@
 #include <list>
 #include <set>
 
+// Thef 4.3 series deprecates hash_set and hash_map.
+// TODO: Migrate this to Boost.Config.
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
+# define BOOST_NO_HASH
+#endif
+
 #if !defined BOOST_NO_HASH
 # ifdef BOOST_HASH_SET_HEADER
 # include BOOST_HASH_SET_HEADER
@@ -60,7 +66,7 @@
 #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
 #if !defined BOOST_NO_SLIST
- struct slistS {};
+ struct slistS {};
 #endif
 
   struct vecS { };
@@ -132,35 +138,35 @@
     struct bind_ { typedef std::vector<T> type; };
   };
 
- struct listS {
+ struct listS {
     template <class T>
     struct bind_ { typedef std::list<T> type; };
   };
 
- struct setS {
+ struct setS {
     template <class T>
     struct bind_ { typedef std::set<T, std::less<T> > type; };
   };
 
- struct multisetS {
+ struct multisetS {
     template <class T>
     struct bind_ { typedef std::multiset<T, std::less<T> > type; };
   };
 
 #if !defined BOOST_NO_HASH
- struct hash_setS {
+ struct hash_setS {
     template <class T>
     struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<T, std::less<T> > type; };
   };
 #endif
 
- struct mapS {
+ struct mapS {
     template <class T>
     struct bind_ { typedef std::set<T, std::less<T> > type; };
   };
 
 #if !defined BOOST_NO_HASH
- struct hash_mapS {
+ struct hash_mapS {
     template <class T>
     struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set<T, std::less<T> > type; };
   };
@@ -199,54 +205,54 @@
   struct parallel_edge_traits { };
 
   template <>
- struct parallel_edge_traits<vecS> {
+ struct parallel_edge_traits<vecS> {
     typedef allow_parallel_edge_tag type; };
 
   template <>
- struct parallel_edge_traits<listS> {
+ struct parallel_edge_traits<listS> {
     typedef allow_parallel_edge_tag type; };
 
 #if !defined BOOST_NO_SLIST
   template <>
- struct parallel_edge_traits<slistS> {
+ struct parallel_edge_traits<slistS> {
     typedef allow_parallel_edge_tag type; };
 #endif
 
   template <>
- struct parallel_edge_traits<setS> {
+ struct parallel_edge_traits<setS> {
     typedef disallow_parallel_edge_tag type; };
 
   template <>
- struct parallel_edge_traits<multisetS> {
+ 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;
+ typedef disallow_parallel_edge_tag type;
   };
 #endif
 
   // mapS is obsolete, replaced with setS
   template <>
- struct parallel_edge_traits<mapS> {
+ 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;
+ typedef disallow_parallel_edge_tag type;
   };
 #endif
 
   namespace detail {
- template <class Directed> struct is_random_access {
+ template <class Directed> struct is_random_access {
       enum { value = false};
       typedef mpl::false_ type;
     };
     template <>
- struct is_random_access<vecS> {
- enum { value = true };
+ struct is_random_access<vecS> {
+ enum { value = true };
       typedef mpl::true_ type;
     };
 
@@ -296,7 +302,7 @@
     typedef typename container_gen<EdgeListS, dummy>::type EdgeContainer;
     typedef typename DirectedS::is_bidir_t BidirectionalT;
     typedef typename DirectedS::is_directed_t DirectedT;
- typedef typename mpl::and_<DirectedT,
+ typedef typename mpl::and_<DirectedT,
       typename mpl::not_<BidirectionalT>::type >::type on_edge_storage;
   public:
     typedef typename mpl::if_<on_edge_storage,
@@ -326,7 +332,7 @@
     : public detail::adj_list_gen<
       adjacency_list<OutEdgeListS,VertexListS,DirectedS,
                      VertexProperty,EdgeProperty,GraphProperty,EdgeListS>,
- VertexListS, OutEdgeListS, DirectedS,
+ VertexListS, OutEdgeListS, DirectedS,
 #if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES)
       typename detail::retag_property_list<vertex_bundle_t,
                                            VertexProperty>::type,
@@ -379,7 +385,7 @@
   private:
     typedef adjacency_list self;
     typedef typename detail::adj_list_gen<
- self, VertexListS, OutEdgeListS, DirectedS,
+ self, VertexListS, OutEdgeListS, DirectedS,
       vertex_property_type, edge_property_type, GraphProperty, EdgeListS
>::type Base;
 
@@ -397,7 +403,7 @@
 
     typedef GraphProperty graph_property_type;
 
- inline adjacency_list(const GraphProperty& p = GraphProperty())
+ inline adjacency_list(const GraphProperty& p = GraphProperty())
       : m_property(p) { }
 
     inline adjacency_list(const adjacency_list& x)
@@ -413,7 +419,7 @@
     }
 
     // Required by Mutable Graph
- inline adjacency_list(vertices_size_type num_vertices,
+ inline adjacency_list(vertices_size_type num_vertices,
                           const GraphProperty& p = GraphProperty())
       : Base(num_vertices), m_property(p) { }
 
@@ -529,12 +535,12 @@
   get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
                                     GraphProperty, EdgeListS>& g)
   {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
+ typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
                                                  EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::type
       result_type;
     return result_type(&g, p);
   }
-
+
   template<typename OutEdgeListS, typename VertexListS, typename DirectedS, typename VertexProperty,
            typename EdgeProperty, typename GraphProperty, typename EdgeListS, typename T, typename Bundle>
   inline
@@ -543,7 +549,7 @@
   get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty, EdgeProperty,
                                     GraphProperty, EdgeListS> const & g)
   {
- typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
+ typedef typename property_map<adjacency_list<OutEdgeListS, VertexListS, DirectedS, VertexProperty,
                                                  EdgeProperty, GraphProperty, EdgeListS>, T Bundle::*>::const_type
       result_type;
     return result_type(&g, p);


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