
Jonathan Turkanis wrote:
Gennadiy Rozental wrote:
The thing is that the majority of the logic is in place just to handle the timing of automatic destruction. The actual act of creating and destroying is generally trivial by comparison. I suspect, though, that the biggest test of the library will be whether or not it compiles. If it compiles, it should almost certainly run correctly.
-Jason
So you are saying that there is no way to initiate automatic destruction when leaving any given scope, only global scope?
I believe some lifetime management policies rely on cleanup of local static variables or on atexit.
Actually, I never use at_exit :D. It is indeed possible to trigger destruction early... the only problem is that that wouldn't be 'automatic' destruction, and as a result it really wouldn't test how the singleton would naturally behave. I need to be able to verify that if no explicit destruction is done by the user, the singleton still does clean itself up on its own, and that multiple singletons clean themselves up on their own in the correct order. -Jason