The new attached handler will be called after this handler
The handler to be attached
The handler that has been connected
Exception if beforeThis is not registered (Always, even if asserts are disabled)
Exception if handler is already registered (Only if asserts are enabled! Does not throw in release mode!)
bool firstCalled, secondCalled, thirdCalled; @safe void handler1() {firstCalled = true;} @safe void handler2() { secondCalled = true; assert(firstCalled); assert(!thirdCalled); } @safe void handler3() { thirdCalled = true; assert(firstCalled); assert(secondCalled); } Signal!() onTest; onTest ~= &handler1; onTest ~= &handler3; onTest.connectBefore(&handler3, &handler2); onTest(); assert(firstCalled && secondCalled && thirdCalled);
Add a handler to be called before another handler.