Low-Lock Singletons In D

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon May 6 14:07:13 PDT 2013


On 5/6/13, dsimcha <dsimcha at yahoo.com> wrote:
> On the advice of Walter and Andrei, I've written a blog article
> about the low-lock Singleton pattern in D.

Personally this covers it for me:

final abstract class singleton
{
static:
    void foo() { }
    int f;
}

void main()
{
    singleton.foo();
    singleton.f = 1;
}

Never needed anything more complex than that. :p


More information about the Digitalmars-d mailing list