This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

constructors, exceptions


>>>>> "chip" == chip  <chip@atlantic.net> writes:

 chip> 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.

 chip> Of course!  Without it, exceptions thrown in (or through)
 chip> constructors would cause irreparable memory leaks. 

Oops.  I misread Chip's message as a feature request rather than a bug
report...  (I thought it was to have a new() INSIDE a constructor
undone automatically on an exception...)

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]