views:

53

answers:

1

Given definitions:

typedef typename boost::graph_traits::adjacency_iterator adjacency_iter;
typedef typename boost::inv_adjacency_iterator_generator::type inv_adjacency_iter;

I am interested in semantics of boost::tie(i, end) = inv_adjacent_vertices((*start);

adjacent_vertices works fine where inv_adjacent_vertices fails with the following:

error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const boost::inv_adjacency_iterator' (or there is no acceptable conversion) C:\boost_1_33_1\boost\tuple\detail\tuple_basic.hpp 637 domain

Tuple_basic.hpp defines adjacency_iterator using access_traits.

inv_adjacency_iterator is defined using the inv_adjacency_iterator_generator...

A: 

First define an in edge iterator:

typedef typename boost::graph_traits<TGraphContainer>::in_edge_iterator TInEdgeIterator;

Then use the InEdge Iterator in the inv_adjacency_iterator_generator:

typedef typename boost::inv_adjacency_iterator_generator<TGraphContainer, TVertex, TInEdgeIterator>::type TInvAdjacencyIterator;

Finally define the range of the vertices for the boost::tie syntax to work:

typedef std::pair<TInvAdjacencyIterator, TInvAdjacencyIterator> TInvAdjacencyVertexRangeType;
ypv