Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-10-27 00:09:05


From: Kevin S. Van Horn <kevin.vanhorn_at_[hidden]>
> My preference for logical errors (ones that the programmer could
> reasonably have avoided) is usually for the program to abort and dump
> core. This allows me to go in with a debugger and see what the state of
> the program was when the error occurred. If you throw an exception the
> stack unwinds, and you lose lots of important debug information. I
> realize that the abort behavior is unacceptable for some industrial
> environments, so let me suggest that there be a preprocessor symbol one
> can set to choose whether violated preconditions (that the implementor
> chooses to check) cause an exception or just abort and dump core.

Why not just call terminate(), which calls abort by default, but which
a program can control at runtime by replacing the terminate_handler?

Also, there was thread back in March entitled "Runtime error reporting"
you might look at, in which I proposed the following hack:

   template <typename X> void error(const X& x) throw() { throw x; }


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