|
Boost Users : |
From: Chris Russell (cdr_at_[hidden])
Date: 2003-08-19 00:12:25
Jeremy straightened me out offlist after staring at my code. For the record,
the problem + solution:
... attempting to retrieve the in_edge_iterator pair for a specific vertex
in a directed graph in the context of a DFS visitor - unable to compile
boost::tie(edgeiniterBegin, edgeiniterEnd) = boost::in_edges(Vertex, Graph).
My problem was that I was running the DFS on a reversed copy of my graph and
attempting to boost::tie to iterator typedefs defined not for the reversed
graph, but rather for the unreversed graph;
I had code that looked like:
mygraph_edge_in_iterator_t edgeiniterBegin, edgeiniterEnd; // NO!
boost::tie(edgeiniterBegin, edgeiniterEnd) = boost::in_edges(Vertex, Graph);
Instead:
typename boost::graph_traits<graph_t>::in_edge_iterator_t edgeiniterBegin,
edgeiniterEnd; // note that graph_t == reverse(mygraph_t)
boost::tie(edgeiniterBegin, edgeiniterEnd) = boost::in_edges(Vertex, Graph);
Thanks Jeremy!
"Jeremy Siek" <jsiek_at_[hidden]> wrote in message
news:35B57E68-D1F4-11D7-876A-0003931A42B8_at_osl.iu.edu...
> Hi Chris,
>
> It sounds like what you're doing is fine... so I'll have to see the
> code.
>
> Cheers,
> Jeremy
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net