[Boost-bugs] [Boost C++ Libraries] #12939: use of boost::graph_bundle with subgraph

Subject: [Boost-bugs] [Boost C++ Libraries] #12939: use of boost::graph_bundle with subgraph
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-29 02:30:41


#12939: use of boost::graph_bundle with subgraph
------------------------------------+----------------------
 Reporter: ioannis.nousias@… | Owner: jewillco
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
  Version: Boost 1.60.0 | Severity: Problem
 Keywords: subgraph, graph_bundle |
------------------------------------+----------------------
 using boost::graph_bundle with a subgraph picks up the 'vertex' access
 delegate. This is because boost::graph_bundle enumeration gets downgraded
 to an integer, which matches the first template specialization in
 subgraph.hpp

 '''example''':
 {{{
 struct VertexProperties { std::string name; };
 struct EdgeProperties { std::string name; };
 struct GraphProperties { std::string name; };

 boost::subgraph< boost::adjacency_list<
         boost::vecS,
         boost::vecS,
         boost::bidirectionalS,
         boost::property<boost::vertex_index_t,size_t,VertexProperties>,
         boost::property<boost::edge_index_t,size_t,EdgeProperties>,
         GraphProperties>
> graph;

 auto name = graph[boost::graph_bundle].name;
 }}}

 '''compiler error:'''
 {{{
 boost/graph/subgraph.hpp:278:24: error: no match for ternary 'operator?:'
 (operand types are 'bool', 'boost::adjacency_list<boost::vecS,
 boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_index_t,
 long unsigned int, tpg::VertexProperties>,
 boost::property<boost::edge_index_t, long unsigned int,
 tpg::EdgeProperties>, tpg::GraphProperties>::graph_bundled {aka
 tpg::GraphProperties}', and 'boost::adjacency_list<boost::vecS,
 boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_index_t,
 long unsigned int, tpg::VertexProperties>,
 boost::property<boost::edge_index_t, long unsigned int,
 tpg::EdgeProperties>, tpg::GraphProperties>::vertex_bundled {aka
 tpg::VertexProperties}')
      { return is_root() ? m_graph[x] : root().m_graph[local_to_global(x)];
 }
                         ^
 boost/graph/subgraph.hpp: In member function 'typename
 boost::graph::detail::bundled_result<Graph, Descriptor>::type&
 boost::subgraph<Graph>::operator[](Descriptor) [with Descriptor =
 boost::graph_bundle_t; Graph = boost::adjacency_list<boost::vecS,
 boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_index_t,
 long unsigned int, tpg::VertexProperties>,
 boost::property<boost::edge_index_t, long unsigned int,
 tpg::EdgeProperties>, tpg::GraphProperties>; typename
 boost::graph::detail::bundled_result<Graph, Descriptor>::type =
 tpg::GraphProperties]':
 boost/graph/subgraph.hpp:278:75: warning: control reaches end of non-void
 function [-Wreturn-type]
      { return is_root() ? m_graph[x] : root().m_graph[local_to_global(x)];
 }
 }}}

 '''workaround/hack''': explicitly use local_property or global_property
 lookup classes.

 {{{
 auto name =
 graph[boost::global_property<boost::graph_bundle_t>(boost::graph_bundle)].name;
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12939>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-03-29 02:33:35 UTC