
Anthony Williams wrote: [...]
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?
Yes. And also cleanup result stuff, if any. Pretty much the same notion (reset() vs destroy() aside for moment) as with statically initialized pthread primitives and corresponding _destroy() calls like pthread_mutex_destroy() that can be used for "pedantic" cleanup of statically initialized pthread objects at process termination to please leak detectors (resources may be acquired dynamically on first use) or whatnot. See also http://groups.google.ca/group/comp.programming.threads/msg/92e475f3d9f2c93c
When would this be used,
That's up to the client. For example, in some module_fini().
and how would it help with static destruction?
Static destruction of what? regards, alexander.