jgro@lia (Jeremy Grodberg) (12/15/90)
I cannot find anywhere in the ARM where the order of destruction of
automatic objects is defined. Am I missing something? If not, I propose
that the ANSI standard add the following to section 6.6 of the ARM:
Objects are guaranteed to be destroyed in the reverse of their order
of creation.
Take, for exampe, the following block:
{
foo a;
foo b;
foo c;
count << "Hello world\n";
}
We are already guaranteed that a will be constructed first, then b, then c,
according to section 6.7. I want to also have the guarantee that on
exit from scope, first c will be destroyed, then b, then a. This has
important implications for objects which reference other objects.
It appears that CFront 2.0 (from AT&T) already does this, but I would
like it to be formalized.
Comments?
--
Jeremy Grodberg "I don't feel witty today. Don't bug me."
jgro@lia.com