Skip to content

Instantly share code, notes, and snippets.

Created August 16, 2017 13:57
What would you like to do?
struct routing_delegator
routing_delegator() {} // default
routing_delegator(std::vector<std::string> r) : ruleset(r) {}
// register functor handler
template <typename F>
void to(F&& f)
routing_data = std::make_unique<typed_routing_recored<decltype(&F::operator())>>(f);
// invoke handler
template <typename... Args>
reply handle(Args&&... args)
auto tuple = std::make_tuple<Args...>(args...);
return routing_data->handle(&tuple);
std::unique_ptr<routing_record> routing_data = nullptr;
std::vector<std::string> ruleset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment