Signal.calculateLength

Calculate the number of registered handlers

Complexity: O(n)

struct Signal(Types...)
@trusted
uint
calculateLength
()

Examples

@safe void handler() {};
@safe void handler2() {};
Signal!() onTest;
assert(onTest.calculateLength() == 0);
onTest.connect(&handler);
assert(onTest.calculateLength() == 1);
onTest.connect(&handler2);
assert(onTest.calculateLength() == 2);
onTest.clear();
assert(onTest.calculateLength() == 0);
onTest();

Meta