I have an event handling code, something like
void handleEventType1(EventType1 event1) {
if (someCheck()){
function1(event);
postCheckTrue();
} else {
function2(event);
postCheckFalse();
}
}
void handleEventType2(EventType2 event2) {
if (someCheck()){
function3(event);
postCheckTrue();
} else {
function4(event);
postCheckFalse();
}
}
I was hoping, I can do something like
handleEvent(event1, Handler::function1, Handler::function2);
handleEvent(event2, Handler::function3, Handler::function4);
that will somehow call functions (1 or 2) or (3 or 4), but I'm somehow not able to solve it to my satisfaction.