Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-09-09 19:56:39


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: <williamkempf_at_h...>
> > When debugging you want the trap to occur as close to the error as
> > possible, which is what asserts are good at. With an exception
the
> > debugger will trap several levels down from where the error
actually
> > occured, possibly even further down than a debugger allows you to
> > traverse back up the stack with. Also, many (most?) debuggers
allow
> > you to step over the assertion, which would allow you to debug
your
> > exception trapping code. To my mind asserts are for debugging and
> > exceptions are for error handling.
>
> The rationale is sound, but the result does not conform to your
> specification. The documentation doesn't state anywhere that a
method
> asserts; it says that the method throws on error.

Does one ever document an assert? Doesn't sound reasonable to me.

Bill Kempf


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