|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-14 17:57:17
----- Original Message -----
From: "Fernando Cacciola" <fcacciola_at_[hidden]>
> ----- Original Message -----
> From: "David Abrahams" <david.abrahams_at_[hidden]>
> > I just want to point out that the termination model used by C++
exceptions
> > makes any approach using them unsuitable for a great many applications.
> >
> > -Dave
> >
> I don't understand what you mean. Could you elaborate it?
Exceptions cause unwinding. Often you don't want that.
Example 1: assertions. By the time the stack is unwound much information is
lost. On Unix, for example, you want a core dump, not an exception. On
Windows you also don't want stack unwinding, though the case is a little
more complicated there.
Example 2: memory allocation tracking and leak detection. An extremely
useful technique involves labeling each allocated block with the call stack
leading to the allocation. If every allocation causes an exception, your
program won't get far.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk