Re: [boost] Enhanced call_once()
by Peter Dimov other posts by this author
Aug 7 2002 10:44AM messages near this date
[boost] Enhanced call_once()
|
Re: [boost] Enhanced call_once()
From: "Andrew J Bromage" <ajb@[...].net>
> G'day all.
>
> In retrospect I shouldn't have brought up a "more powerful"
> call_once function, because that's not what I want at all. What
> I "really" want is this:
>
> class once
> {
> public:
> once();
> ~once();
> call_once(function0<void>&);
> };
Are you sure that you want that. The whole point of the
template<class F> void call_once(F f, once_flag & flag);
construct is that once_flag is a POD, and can be statically initialized, so
you don't have to worry about initialization order issues.
Your "once" object is dynamically initialized. It is pretty much the same as
a boost::mutex; there is no reason for it to be more efficient than a mutex.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Andrew J Bromage
Peter Dimov
Andrew J Bromage
William E. Kempf
Andrew J Bromage
William E. Kempf
Alexander Terekhov
Pete Becker
Andrew J Bromage
Peter Dimov
Andrew J Bromage
William E. Kempf
Andrew J Bromage
William E. Kempf
Rene Rivera
William E. Kempf
Andrew J Bromage
Jason Stewart
Andrew J Bromage
Andrew J Bromage
Rob Stewart
William E. Kempf
William E. Kempf
Alexander Terekhov
Peter Dimov
Peter Dimov
Pete Becker
William E. Kempf
William E. Kempf
Pete Becker
|