|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77632 - in trunk/boost/graph: . detail
From: jewillco_at_[hidden]
Date: 2012-03-29 14:42:05
Author: jewillco
Date: 2012-03-29 14:42:04 EDT (Thu, 29 Mar 2012)
New Revision: 77632
URL: http://svn.boost.org/trac/boost/changeset/77632
Log:
Changed more things to inheritance to allow more SFINAE and fixed accessibility problem
Text files modified:
trunk/boost/graph/detail/adjacency_list.hpp | 53 +++++++++++++--------------------------
trunk/boost/graph/properties.hpp | 36 ++++++++++++---------------
trunk/boost/graph/undirected_graph.hpp | 6 ---
3 files changed, 35 insertions(+), 60 deletions(-)
Modified: trunk/boost/graph/detail/adjacency_list.hpp
==============================================================================
--- trunk/boost/graph/detail/adjacency_list.hpp (original)
+++ trunk/boost/graph/detail/adjacency_list.hpp 2012-03-29 14:42:04 EDT (Thu, 29 Mar 2012)
@@ -2574,14 +2574,13 @@
};
namespace detail {
template <class Tag, class Graph, class Property>
- struct adj_list_choose_vertex_pa {
- typedef typename
- boost::mpl::if_<boost::is_same<Tag, vertex_all_t>, adj_list_all_vertex_pa, adj_list_any_vertex_pa>::type
- Helper;
- typedef typename Helper::template bind_<Tag,Graph,Property> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct adj_list_choose_vertex_pa
+ : boost::mpl::if_<
+ boost::is_same<Tag, vertex_all_t>,
+ adj_list_all_vertex_pa,
+ adj_list_any_vertex_pa>::type
+ ::template bind_<Tag, Graph, Property>
+ {};
template <class Tag>
@@ -2597,12 +2596,9 @@
typedef vec_adj_list_all_vertex_pa type;
};
template <class Tag, class Graph, class Property>
- struct vec_adj_list_choose_vertex_pa {
- typedef typename vec_adj_list_choose_vertex_pa_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Tag,Graph,Property> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct vec_adj_list_choose_vertex_pa
+ : vec_adj_list_choose_vertex_pa_helper<Tag>::type::template bind_<Tag,Graph,Property>
+ {};
} // namespace detail
//=========================================================================
@@ -2693,19 +2689,12 @@
typedef adj_list_all_edge_pmap type;
};
template <class Tag, class Graph, class Property>
- struct adj_list_choose_edge_pmap {
- typedef typename adj_list_choose_edge_pmap_helper<Tag>::type Helper;
- typedef typename Helper::template bind_<Graph,Property,Tag> Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct adj_list_choose_edge_pmap
+ : adj_list_choose_edge_pmap_helper<Tag>::type::template bind_<Graph, Property, Tag>
+ {};
struct adj_list_edge_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef adj_list_choose_edge_pmap<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_: adj_list_choose_edge_pmap<Tag, Graph, Property> {};
};
} // namespace detail
@@ -2722,11 +2711,9 @@
struct adj_list_vertex_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef detail::adj_list_choose_vertex_pa<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_
+ : detail::adj_list_choose_vertex_pa<Tag,Graph,Property>
+ {};
};
template <>
struct vertex_property_selector<adj_list_tag> {
@@ -2735,11 +2722,7 @@
struct vec_adj_list_vertex_property_selector {
template <class Graph, class Property, class Tag>
- struct bind_ {
- typedef detail::vec_adj_list_choose_vertex_pa<Tag,Graph,Property> Choice;
- typedef typename Choice::type type;
- typedef typename Choice::const_type const_type;
- };
+ struct bind_: detail::vec_adj_list_choose_vertex_pa<Tag,Graph,Property> {};
};
template <>
struct vertex_property_selector<vec_adj_list_tag> {
Modified: trunk/boost/graph/properties.hpp
==============================================================================
--- trunk/boost/graph/properties.hpp (original)
+++ trunk/boost/graph/properties.hpp 2012-03-29 14:42:04 EDT (Thu, 29 Mar 2012)
@@ -205,27 +205,23 @@
};
template <class Graph, class PropertyTag>
- struct edge_property_map {
- typedef typename edge_property_type<Graph>::type Property;
- typedef typename graph_tag_or_void<Graph>::type graph_tag;
- typedef typename edge_property_selector<graph_tag>::type Selector;
- typedef typename Selector::template bind_<Graph,Property,PropertyTag>
- Bind;
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct edge_property_map
+ : edge_property_selector<
+ typename graph_tag_or_void<Graph>::type
+ >::type::template bind_<
+ Graph,
+ typename edge_property_type<Graph>::type,
+ PropertyTag>
+ {};
template <class Graph, class PropertyTag>
- class vertex_property_map {
- public:
- typedef typename vertex_property_type<Graph>::type Property;
- typedef typename graph_tag_or_void<Graph>::type graph_tag;
- typedef typename vertex_property_selector<graph_tag>::type Selector;
- typedef typename Selector::template bind_<Graph,Property,PropertyTag>
- Bind;
- public:
- typedef typename Bind::type type;
- typedef typename Bind::const_type const_type;
- };
+ struct vertex_property_map
+ : vertex_property_selector<
+ typename graph_tag_or_void<Graph>::type
+ >::type::template bind_<
+ Graph,
+ typename vertex_property_type<Graph>::type,
+ PropertyTag>
+ {};
} // namespace detail
template <class Graph, class Property>
Modified: trunk/boost/graph/undirected_graph.hpp
==============================================================================
--- trunk/boost/graph/undirected_graph.hpp (original)
+++ trunk/boost/graph/undirected_graph.hpp 2012-03-29 14:42:04 EDT (Thu, 29 Mar 2012)
@@ -529,11 +529,7 @@
{ return remove_in_edge_if(v, pred, g.impl()); }
template <UNDIRECTED_GRAPH_PARAMS, typename Property>
-struct property_map<UNDIRECTED_GRAPH, Property> {
- typedef typename UNDIRECTED_GRAPH::graph_type Graph;
- typedef typename property_map<Graph, Property>::type type;
- typedef typename property_map<Graph, Property>::const_type const_type;
-};
+struct property_map<UNDIRECTED_GRAPH, Property>: property_map<typename UNDIRECTED_GRAPH::graph_type, Property> {};
// PropertyGraph concepts
template <UNDIRECTED_GRAPH_PARAMS, typename Property>
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