RehashingAA.onRehashDg

Delegate called when rehashing takes place.

struct RehashingAA(AA : V[K], V, K)
void delegate(ref AA) @(system) onRehashDg;

Examples

uint counter;

void dg(ref int[string] aa)
{
    ++counter;
    writeln("Rehashed!");
}

RehashingAA!(int[string]) aa;
aa.onRehashDg = &dg;
aa.minimumNeededForRehash = 2;

aa["abc"] = 123;
aa["def"] = 456;
aa["ghi"] = 789;

assert(aa.numRehashes == 1);
assert(counter == 1);

Meta