This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exceptions in constructor?
- To: pkoning at xedia dot com (Paul Koning)
- Subject: Re: Exceptions in constructor?
- From: chip at atlantic dot net
- Date: Mon, 27 Oct 1997 09:37:59 -0500 (EST)
- Cc: chip at pobox dot com, egcs at cygnus dot com
- Reply-To: chip at pobox dot com
According to Paul Koning:
> >>>>> "chip" == chip <chip@atlantic.net> writes:
> chip> I'm 99.44% pleased with the exception-based code I can now
> chip> write and test under Linux on x86. The remaining .56% would be
> chip> fulfilled if throwing an exception in a constructor
> chip> automatically called the appropriate operator delete () if
> chip> there had been a call to operator new ().
>
> Does the C++ standard say to do that? It would surprise me.
Of course! Without it, exceptions thrown in (or through) constructors
would cause irreparable memory leaks.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"He's Mr. Big of 'Big And Tall' fame." // MST3K