
7 Sep
2005
7 Sep
'05
9:25 p.m.
Anthony Williams wrote: [...]
Destruction of once_flags with static storage duration.
If we store the return value along with the once_flag, then we really ought to destroy it properly, when the once_flag is destroyed. If a once_flag has static storage duration, and has a non-trivial destructor that does cleanup, then we have a classic singleton cleanup problem, as John Maddock pointed out --- the order of static destruction can now be important.
You mean an extra non-POD version? That's not your problem... as long as you provide a POD version + call_once_reset/destroy(). regards, alexander.