Skip to content

Instantly share code, notes, and snippets.

@xaxxon
Created January 15, 2016 04:29
Show Gist options
  • Save xaxxon/f91222298e31b1eb5507 to your computer and use it in GitHub Desktop.
Save xaxxon/f91222298e31b1eb5507 to your computer and use it in GitHub Desktop.
template<int depth, typename METHOD_TYPE, typename RET, typename CLASS_TYPE>
struct Caller<depth, METHOD_TYPE, RET(CLASS_TYPE::*)() const> {
public:
// the final class in the call chain stores the actual method to be called
enum {DEPTH=depth, ARITY=0};
// This call method actually calls the method with the specified object and the
// parameter pack that was built up via the chain of calls between templated types
template<typename ... Ts>
void operator()(METHOD_TYPE method, CLASS_TYPE & object, const v8::FunctionCallbackInfo<v8::Value> & info, Ts... ts) {
RunMethod<METHOD_TYPE>()(object, method, info, ts...);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment