RE: [Boost-Users] [BGL] Best way to abort an algorithm from withi n a visitor?

Steve M. Robbins [mailto:steven.robbins@videotron.ca] wrote:
An exception tells me "Oops, something went wrong here" not "we succeeded, here's the answer". Many of the exceptions I catch are called "oops": try { /* ... */ } catch (std::exception &oops) { /* ... */ } One possible snag might be if your code interacts with someone else's code, which will catch the exception and not pass it on to you. In the context we're talking about, though, I don't see that as a significant problem. An exception is certainly an easy way to abort the search, and since I don't have an alternative to offer, I'll shut up now ;=) -- Jim

Hi Jim, the problem here is that when using the generic BGL algorithms,
there's no explicit way to feed control information (e.g. stop - I found
what I need) back to the algorithm that is sequencing through the graph and
dispatching "events" into your visitor code. I'm guessing the lack of such a
feedback path in the first several algorithms I've looked at is due to the
fact that aborting the algorithm is an atypical requirement?
"Jim.Hyslop"
participants (2)
-
Chris Russell
-
Jim.Hyslop