🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #421

Re: Ordering constraints on static constructors/destructors

#421
From: Andrew Koenig
Date: Thu, 23 Aug 1990 16:40
19 lines
1192 bytes
In article <1990Aug22.160805.8519@sco.COM>, tom@sco.COM (Tom Kelly) writes:

> 	Destructors (12.4) for initialized static objects are called
> 	when returning from main() and when calling exit().
> 	Destruction is done in reverse order of initialization.

> Does the last sentence mean that the destructor order is constrained
> to be the reverse of the total order actually executed for this run
> of the program, or just that it must be compatible with the reversed
> partial order?

It means that the objects must be destroyed in precisely the reverse
order of their construction.

It's not good enough to pick a random one of the inverses of the
partial ordering.
-- 
				--Andrew Koenig
				  ark@europa.att.com
Technical Details
Message-ID: <11228@alice.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark
References: <1990Aug22.160805.8519@sco.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark
From: ark@alice.UUCP (Andrew Koenig)
Newsgroups: comp.std.c++
Subject: Re: Ordering constraints on static constructors/destructors
Message-ID: <11228@alice.UUCP>
Date: 23 Aug 90 16:40:00 GMT
References: <1990Aug22.160805.8519@sco.COM>
Organization: AT&T Bell Laboratories, Liberty Corner NJ
Lines: 19