From 10d71f23654a60f32eb494836660ce6f65b2f05d Mon Sep 17 00:00:00 2001 From: Andrew Sutton Date: Mon, 3 Nov 2008 15:03:13 +0000 Subject: [PATCH] Added a compiler check to adjacency_list.hpp that checks for GCC >= 4.3 and defines BOOST_NO_HASH. Closes #2444. [SVN r49554] --- include/boost/graph/adjacency_list.hpp | 58 ++++++++++++++------------ 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/include/boost/graph/adjacency_list.hpp b/include/boost/graph/adjacency_list.hpp index 9f019f74..e75ed169 100644 --- a/include/boost/graph/adjacency_list.hpp +++ b/include/boost/graph/adjacency_list.hpp @@ -17,6 +17,12 @@ #include #include +// 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 @@ namespace boost { #if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #if !defined BOOST_NO_SLIST - struct slistS {}; + struct slistS {}; #endif struct vecS { }; @@ -132,35 +138,35 @@ namespace boost { struct bind_ { typedef std::vector type; }; }; - struct listS { + struct listS { template struct bind_ { typedef std::list type; }; }; - struct setS { + struct setS { template struct bind_ { typedef std::set > type; }; }; - struct multisetS { + struct multisetS { template struct bind_ { typedef std::multiset > type; }; }; #if !defined BOOST_NO_HASH - struct hash_setS { + struct hash_setS { template struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set > type; }; }; #endif - struct mapS { + struct mapS { template struct bind_ { typedef std::set > type; }; }; #if !defined BOOST_NO_HASH - struct hash_mapS { + struct hash_mapS { template struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set > type; }; }; @@ -199,54 +205,54 @@ namespace boost { struct parallel_edge_traits { }; template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; #if !defined BOOST_NO_SLIST template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; #endif template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef disallow_parallel_edge_tag type; }; template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; #if !defined BOOST_NO_HASH template <> struct parallel_edge_traits { - typedef disallow_parallel_edge_tag type; + typedef disallow_parallel_edge_tag type; }; #endif // mapS is obsolete, replaced with setS template <> - struct parallel_edge_traits { + struct parallel_edge_traits { typedef disallow_parallel_edge_tag type; }; #if !defined BOOST_NO_HASH template <> struct parallel_edge_traits { - typedef disallow_parallel_edge_tag type; + typedef disallow_parallel_edge_tag type; }; #endif namespace detail { - template struct is_random_access { + template struct is_random_access { enum { value = false}; typedef mpl::false_ type; }; template <> - struct is_random_access { - enum { value = true }; + struct is_random_access { + enum { value = true }; typedef mpl::true_ type; }; @@ -296,7 +302,7 @@ namespace boost { typedef typename container_gen::type EdgeContainer; typedef typename DirectedS::is_bidir_t BidirectionalT; typedef typename DirectedS::is_directed_t DirectedT; - typedef typename mpl::and_::type >::type on_edge_storage; public: typedef typename mpl::if_, - VertexListS, OutEdgeListS, DirectedS, + VertexListS, OutEdgeListS, DirectedS, #if !defined(BOOST_GRAPH_NO_BUNDLED_PROPERTIES) typename detail::retag_property_list::type, @@ -379,7 +385,7 @@ namespace boost { 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 @@ namespace boost { 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 @@ namespace boost { } // 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 @@ namespace boost { get(T Bundle::* p, adjacency_list& g) { - typedef typename property_map, T Bundle::*>::type result_type; return result_type(&g, p); } - + template inline @@ -543,7 +549,7 @@ namespace boost { get(T Bundle::* p, adjacency_list const & g) { - typedef typename property_map, T Bundle::*>::const_type result_type; return result_type(&g, p);