Serve said:
Does the C++ standard say whether destructors are called before or after
"atexit" functions are called.
Or is nothing said about that?
3.6.3/3 says
"If a function is registered with atexit then following the
call to exit, any objects with static storage duration initialized
prior to the registration of that function shall not be
destroyed until the registered function is called from the
termination process and has completed.
For an object with static storage duration constructed after a
function is registered with atexit, then following the call to
to exit, the registered function is not called until the execution
of the object's destructor has completed.
If atexit is called during the construction of an object, the
complete object to which it belongs shall be destroyed
before the registered function is called."
Jacques.