Boost logo

Boost Users :

From: Peter Aronsson (petar_at_[hidden])
Date: 2004-03-09 05:33:10


Hi,

I have a problem with traversing over all parents of a vertex.
If I use (the undocumented?) inv_adjacency_iterator_generator class to
return iterators for the parents (predecessors) of a vertex I get a
compile error. It worked on an earlier version of the library (in debian
testing), but does not work for the latest version(1.31.0).
I think the problem is that it can no longer find a suitable constructor.

Here is my code:

// some typedefs removed......
typedef boost::graph_traits<TaskGraph>::in_edge_iterator InEdgeIterator;
typedef boost::adjacency_list<boost::listS, boost::listS,
                  boost::bidirectionalS,
               VertexProperty, EdgeProperty> TaskGraph;
typedef boost::inv_adjacency_iterator_generator<TaskGraph, VertexID,
InEdgeIterator>::type ParentsIterator;

 std::pair<ParentsIterator, ParentsIterator>
 parents(VertexID v, TaskGraph &tg)
{
  InEdgeIterator e,e_end;
  tie(e,e_end) = in_edges(v,tg);
  ParentsIterator c(e),c_end(e_end); // problem here. No suitable
constructor.
  return make_pair(e,e_end);
}

(Traversing through the children/predecessors works fine.)

Regards Peter Aronsson

-- 
 _________________________________________________________________
/ Peter Aronsson, Phd Student at PELAB (Programming Environments  \ 
| Laboratory ) Department for Computer & Information Science      | 
| Linköping University, Sweden                                    | 
|=================================================================|
| petar_at_[hidden] , phone +46 (0)13-28 1737 Room 3B:490          |
\_________________________________________________________________/

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