Boost logo

Boost :

From: John Torjo (john_at_[hidden])
Date: 2003-05-08 06:52:14


> > Under win32, my assert method uses
> >
> > if (IsDebuggerPresent())
> > {
> > DebugBreak(); // ammounts to int 3 on intel
> > }
>
> Maybe that is the 4th alternative I couldn't think of earlier :-). I also
> thought of one more: emailling the system administrator. Useful on
servers.

Indeed ;-)
That's cool!

The thing about emailing the system admin: sure, it's possible.

>
> > which I find better than the debugger catching an exception. At my last
> > work place, we made asserts through exceptions but ended up with
> > exceptions being thrown in destructors and such which wasn't very nice,
> > especially if the destructor was being called during clean up because of
> > a previous exception.
>
> I hadn't thought of such issues. Is uncaught_exception() implemented in
all
> modern compilers? Falling back on one of the other methods when it returns
> true instead of throwing an exception avoids some of the problems.
>

On VC6, uncaught_exception always returns false. Kind of bad :-(

Best,
John


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