2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-01 20:42:11 +00:00

Added a compiler check to adjacency_list.hpp that checks for GCC >= 4.3 and

defines BOOST_NO_HASH. Closes #2444.


[SVN r49554]
This commit is contained in:
Andrew Sutton
2008-11-03 15:03:13 +00:00
parent 7db8d06fbf
commit 10d71f2365

View File

@@ -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 @@ 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<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 @@ namespace boost {
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 @@ namespace boost {
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 @@ namespace boost {
: 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 @@ 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<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 @@ namespace boost {
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);