Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-08-13 11:35:14


> Personally I think the Singleton implementation provided by Andrei
> Alexandrescu in his "Modern C++ Design" book is pretty good. I'm not
saying
> it can't be improved on (he starts out by conceding that the Singleton
> concept can have many incarnations, but his implementation provides most
of
> the usual variations through policies).
> There may be other problems with it - maybe someone else could give some
> examples - but as I see it a likely obstacle to having a Loki-like
Singleton
> accepted into boost is that it relies heavily on atexit(), which seems to
be
> inconsistently implemented across compilers.
> Does anyone have any workarounds for that?

how about your own atexit() impl based on top
of yet another thread-safe static local singleton?
it could also help to solve the problem of
"Implementation Limits: The implementation shall
support the registration of at least 32 functions."

regards,
alexander.


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