Boost logo

Boost :

From: Chris Russell (cdr_at_[hidden])
Date: 2003-06-05 14:36:50


Hello,
I've got a struct derived from boost::default_dfs_visitor that I've been
using w/out any problems in an invocation of boost::depth_first_search.

The call that works looks like:
boost::depth_first_search(g, boost::visitor(MyDfsVisitor));
^- NP. compiles and executes fine.

Now I'm trying to use the exact same visitor in the context of a
boost::depth_first_visit call (so I can set the starting vertex). But I'm
having big troubles.

I tried this:
boost::depth_first_visit(g, s, boost::vistor(MyDfsVisitor),
boost::get(boost::vertex_color, g)) // note I'm using an internal, default
color map
^- this won't compile. It seems to be balking duing Jeremy's visitor concept
checking? The compiler errors are extensive and it looks like none of the
visitor methods are being correctly identified. (e.g. missing
vis.InitializeVertex ... etc. etc..)

p.172 of the BGL book on DFS notes: IN: visitor(DFSVisitor vis) whereas
p.175 on DFV notes: IN: DFSVisitor visitor.

So I guessed and tried this syntax:

boost:depth_first_visit(g, s, MyDfsVisitor, boost::get(boost::vertex_color,
g))
^- this compiles. But I'm getting an exception fault during visitor
invocation somewhere deep inside the the RTL.

Can anyone enlighten me about what's going on here? What exactly does
boost::vistor(X) do? And why is it needed on the DFS call, and apparently
rejected in the DFV call?

Any help would be sincerely appreciated.

- Regards
Chris


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