UnitTest destruction order?


A non-local static UnitTest class registers itself in a static local Array (by calling getAllTests( )) in its constructor. While in its destructor this class unregisters from that Array. Is there any C++ rule in the standard that manages the order of those destructions (to guarantee that the non-local static class is destroyed before the local static class) or is it undefined?  

NB: I can not find a definitive response (browsing with google). Help is welcomed.

Oops, i should have searched a bit more.

So according to:


"If the completion of the constructor or dynamic initialization of an object with static storage duration is sequenced before that of another, the completion of the destructor of the second is sequenced before the initiation of the destructor of the first."



That is not undefined. That is safe.