
2 Sep
2005
2 Sep
'05
5:36 p.m.
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?