Path: 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 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