[ECGS] Exceptions in constructor?

chip@atlantic.net chip@atlantic.net
Mon Oct 27 17:36:00 GMT 1997


According to John A. Tamplin:

> I believe the original post was referring to how the compiler builds
> a default constructor, in that it should catch exceptions after
> memory is allocated and free that memory before passing any
> exceptions to the caller.  If an exception occurs in operator new,
> it needs to catch that exception and clean up after itself before
> passing it up the chain.

No, the original post (mine) was talking about exceptions in the
constructor, and how they require calls to operator delete () if the
object being constructed is not auto.

Exceptions thrown in operator new () are relatively simple.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
        "He's Mr. Big of 'Big And Tall' fame."  // MST3K



More information about the Gcc mailing list