ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] Enhanced call_once()
by William E. Kempf other posts by this author
Aug 7 2002 1:54PM messages near this date
Re: [boost] Enhanced call_once() | [boost] Re: Enhanced call_once()
----- Original Message -----
From: "Andrew J Bromage" <ajb@[...].net> 
To: <boost@[...].org> 
Sent: Tuesday, August 06, 2002 7:50 PM
Subject: Re: [boost] Enhanced call_once()


>  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>&);
>  };

Since call_once relies on static initialization the type has to be POD,
which means it would be more like this:

class once
{
public:
   typedef ... flag_type;
   flag_type flag;
   call_once(function0<void> &);
};

boost::once once = BOOST_ONCE_INIT;
once.call_once(&foo);

So you change the syntax slightly, but that's about all.

Again, I'd love to be proven wrong about the POD requirements and would love
to see any implementation that would work with out it.

Bill Kempf
_______________________________________________
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved