Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-09-02 12:36:35


Peter Dimov wrote:
> Alexander Terekhov wrote:
>> Peter Dimov wrote:
>> [...]
>>> I like the signature of call_once:
>>>
>>> template<typename Function>
>>> void call_once(Function f, once_flag& flag)
>>
>> Only as long as you stick to void Functions. Or am I just missing
>> something?
>
> Well, it's better than void(*)() and has enough expressive power to
> emulate the rest.
>
> The "typename result_of<Function()>::type" version is slightly harder
> to specify and implement. Probably not much, though.

On second thought, a non-void return doesn't make sense; what could it
return when call_once is called a second time?


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