
Alexander Terekhov <terekhov@web.de> writes:
Anthony Williams wrote: [...]
Despite tendering a version that handles non-void returns, I am not sure how to do it right (destruction order for statics makes it hard), so I have left that out for now.
Why not simply make once_flag POD and provide call_once_reset()? Plus convenient (derived) non-POD class for dynamic context?
That's easy: because I didn't think of it. I can understand what you're getting at with the derived class for dynamic contexts, such as class members, but how are you envisioning the call_once_reset function working? Would it take a specific once_flag as a parameter, and reset it, as if it has never been called? When would this be used, and how would it help with static destruction? Anthony -- Anthony Williams Software Developer