Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2005-09-08 08:06:43


Alexander Terekhov <terekhov_at_[hidden]> writes:

> John Maddock wrote:
>> If a return value is truly required, then we could use aligned_storage to
>> provide raw storage for the return value and construct the object on first
>> call to the one procedure, but that still doesn't solve the destruction
>> problem.
>
> That's not your problem as long as you don't destruct and instead
> provide _reset/destroy/init() calls.

OK. Lets assume that solving the destruction problem is not the library
writer's problem.

Assume also that the library supplies a once_flag, a call_once function that
returns the same result every time, but only calls the function once, and
once_init, once_reset and once_destroy. Each once_flag must be passed to
once_destroy in order to clean up the stored return value.

As a user of this library, how do I ensure that every once_flag is correctly
cleaned up?

Anthony

-- 
Anthony Williams
Software Developer
Just Software Solutions Ltd
http://www.justsoftwaresolutions.co.uk

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk