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

Changed more things to inheritance to allow more SFINAE and fixed accessibility problem

[SVN r77632]
This commit is contained in:
Jeremiah Willcock
2012-03-29 18:42:04 +00:00
parent 771d9307cc
commit 5d1e1ce628
3 changed files with 35 additions and 60 deletions

View File

@@ -2574,14 +2574,13 @@ namespace boost {
};
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 @@ namespace boost {
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 @@ namespace boost {
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 @@ namespace boost {
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 @@ namespace boost {
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> {

View File

@@ -205,27 +205,23 @@ namespace boost {
};
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>

View File

@@ -529,11 +529,7 @@ remove_in_edge_if(typename UNDIRECTED_GRAPH::vertex_descriptor v,
{ 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>