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.

Reply via email to