Skip to content

Instantly share code, notes, and snippets.

@cjameshuff
Last active December 11, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjameshuff/4520680 to your computer and use it in GitHub Desktop.
Save cjameshuff/4520680 to your computer and use it in GitHub Desktop.
template<typename cb_t>
void add_handler(const cb_t & cb) {
auto existing = globalEventHandlers[event];
globalEventHandlers[event] = (existing)? []() -> bool {
if(cb())
return true;
return existing();
} : cb;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment