Last active
August 29, 2015 14:25
-
-
Save netbsduser/14783987f2d1b17bc775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename Func, Func func> struct thunk; | |
template<typename Class, typename R, typename ...Args, R(Class::*func)(Args...)> | |
struct thunk<R(Class::*)(Args...), func> | |
{ | |
static R call(Tox *tox, Args ...args, void *userData) | |
{ | |
return ((*static_cast<Class *>(userData)).*func)(args...); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment