Boost logo

Boost :

Subject: [boost] [graph] "get" bundled properties removed?
From: Fabien Castan (fabcastan_at_[hidden])
Date: 2012-09-11 01:11:13


Hi,

The "get" function for bundled properties has been removed in the 1.51
release of boost and I don't know what is the new way to do this.

This code doesn't compile anymore:
> boost::write_graphviz( os, g.getGraph(),
> make_simple_node_writer( get( &Vertex::_name, g.getGraph() ) ),
> make_simple_node_writer( get( &ProcessEdge::_name, g.getGraph() )
) );
https://github.com/tuttleofx/TuttleOFX/blob/master/libraries/tuttle/src/tuttle/host/graph/GraphExporter.tcc#L76

The following code has been completely removed from
"boost/graph/adjacency_list.hpp":
"
  // Support for bundled properties
#ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
  template<typename OutEdgeListS, typename VertexListS, typename DirectedS,
typename VertexProperty,
           typename EdgeProperty, typename GraphProperty, typename
EdgeListS, typename T, typename Bundle>
  inline
  typename property_map<adjacency_list<OutEdgeListS, VertexListS,
DirectedS, VertexProperty, EdgeProperty,
                                       GraphProperty, EdgeListS>, T
Bundle::*>::type
  get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS,
VertexProperty, EdgeProperty,
                                    GraphProperty, EdgeListS>& g)
  {
    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
  typename property_map<adjacency_list<OutEdgeListS, VertexListS,
DirectedS, VertexProperty, EdgeProperty,
                                       GraphProperty, EdgeListS>, T
Bundle::*>::const_type
  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,
                                                 EdgeProperty,
GraphProperty, EdgeListS>, T Bundle::*>::const_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,
           typename Key>
  inline T
  get(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS,
VertexProperty, EdgeProperty,
                                    GraphProperty, EdgeListS> const & g,
const Key& key)
  {
    return get(get(p, g), key);
  }

  template<typename OutEdgeListS, typename VertexListS, typename DirectedS,
typename VertexProperty,
           typename EdgeProperty, typename GraphProperty, typename
EdgeListS, typename T, typename Bundle,
           typename Key>
  inline void
  put(T Bundle::* p, adjacency_list<OutEdgeListS, VertexListS, DirectedS,
VertexProperty, EdgeProperty,
                                    GraphProperty, EdgeListS>& g, const
Key& key, const T& value)
  {
    put(get(p, g), key, value);
  }

#endif
"

What is the replacement to this "get" accessor?

Regards,
Fabien


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk