confusion about structs

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Sep 25 15:04:48 PDT 2011


This should make things clearer for you:

unittest
{
    auto h1 = get(1);
    auto h2 = get(2);

    assert(h1 is h2);  // both reference the same array
}

Field initialization is only done once (once per thread, or if a field
is shared once on app start) and not each time you call the
constructor.


More information about the Digitalmars-d-learn mailing list