开发者

Can someone post an example of creating a boost inv_adjacency_iterator using inv_adjacency_iterator_generator?

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_b开发者_StackOverflow中文版asic.hpp 637 domain

Tuple_basic.hpp defines adjacency_iterator using access_traits.

inv_adjacency_iterator is defined using the inv_adjacency_iterator_generator...


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜