Boost logo

Boost Users :

From: Chris Russell (cdr_at_[hidden])
Date: 2002-09-18 15:27:11


> Now if you've got more than a hundred or so entries left to go, exceptions
> really are the greener grass.
>

The size of the graph is not known a-priori (not at coding time anyway) but
is likely to be quite large.

> What's wrong with 'return', perhaps along-side some sort of 'done' status
> variable? I'm only vaguely familiar with the visitor pattern, but these
> would seem to be the obvious choice.
>

See my earlier reply. In this case I'm deriving my visitor from a base and
overriding "event" handlers that receive their marching orders via const
references and return void. So there's no way to affect feedback to the
algorithm's dispatcher without actually making modifications to the
algorithm code.

"Mark Storer" <mstorer_at_[hidden]> wrote in message
news:E840F0B7E6189547BDB91DA8BF2228AB016255F8_at_csmail.cardiff.com...
> If efficiency is your goal, exceptions are not the answer. Just enabling
> exceptions at compile time makes a noticable performance hit. Actually
> throwing an exception can gobble up a 1000 cycles, give or take. That's
per
> throw. If you catch and throw again, you'll pay again.
>
> Now if you've got more than a hundred or so entries left to go, exceptions
> really are the greener grass.
>
> What's wrong with 'return', perhaps along-side some sort of 'done' status
> variable? I'm only vaguely familiar with the vistor pattern, but these
> would seem to be the obvious choice.
>
> --Mark Storer
> Software Engineer
> Cardiff Software
>
> #include <disclaimer>
> typedef std::disclaimer<Cardiff> Discard;
>


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