|
Boost Users : |
From: Chris Russell (cdr_at_[hidden])
Date: 2003-06-06 07:56:35
I initially posted this to the devel list. Apologies for reposting it to the
user list but this is really a library _user_ question - not a devel
question.
I've now screwed around with this for the better part of a day and haven't
figured it out. I'm off re-reading BGL book 2.5 concept checking explanation
but I'll still baffled. I will post the compiler errors if anyone is willing
to give me hand understanding why I can't get what I believe should be quite
a simple case working.
Here's the problem statement:
--- 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-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