Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-05-20 05:21:52


Dave,

Just to point out that the following snippet is not thread safe - this may
or may not be a problem - see the recent discussion on
comp.lang.c++.moderated (I think it was "thread safe singleton").

>template <class Derived, class Base>
Derived* Singleton<Derived,Base>::singleton()
{
    static Derived x;
    return &x;
}
<

- John.


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