The new attached handler will be called after this handler
The handler to be attached
The handler that has been connected
Exception if handler is already registered (Only if asserts are enabled! Does not throw in release mode!)
Exception if afterThis is not registered (Always, even if asserts are disabled)
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 ~= &handler2; auto h = onTest.connectAfter(&handler1, &handler3); assert(h == &handler3); onTest(); assert(firstCalled && secondCalled && thirdCalled);
Add a handler to be called after another handler.