mutexedAA

Convenience function to create and setup a MutexedAA instance in one go. MutexedAA.setup need as such not be called.

  1. auto mutexedAA()
    mutexedAA
    (
    AA : V[K]
    V
    K
    )
    ()
    if (
    __traits(isAssociativeArray, AA)
    )
  2. auto mutexedAA(AA orig)

Parameters

AA

Associative array type.

V

Value type.

K

Key type.

Return Value

Type: auto

A new MutexedAA instance.

Examples

MutexedAA!(string[int]) aa;
aa.setup();  // important!

auto aa2 = mutexedAA!(string[int]);
// no need to setup
{
    MutexedAA!(string[int]) aa;
    assert(!aa.isReady);  // internal mutex not instantiated, requires .setup()
}
{
    auto aa = mutexedAA!(string[int]);
    assert(aa.isReady);  // mutex is in place already, no need to .setup()
}