Skip to content

Instantly share code, notes, and snippets.

@dario2994
Created January 25, 2017 23:58
Show Gist options
  • Save dario2994/f57e93fecb85c92618f5c0a8728ee8f6 to your computer and use it in GitHub Desktop.
Save dario2994/f57e93fecb85c92618f5c0a8728ee8f6 to your computer and use it in GitHub Desktop.
Function evaluating a member function for the given instance passing the given arguments.
template <typename T, typename ClassT, typename ...ArgT>
T EvaluateMemberFunction(ClassT& b, T (ClassT::*method)(ArgT...), ArgT... args) {
return (b.*method)(args...);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment