Skip to content

Instantly share code, notes, and snippets.

@valbok
Created August 23, 2016 12:53
Show Gist options
  • Save valbok/e69642a4f43a057053df6b84a3594b75 to your computer and use it in GitHub Desktop.
Save valbok/e69642a4f43a057053df6b84a3594b75 to your computer and use it in GitHub Desktop.
#include <iostream>
struct A{
void duck() {
std::cout <<"crya\n";
}
};
typedef void (A::*Call)();
void call(A* a, Call c) {
(a->*c)();
}
int main() {
A a;
call(&a, &A::duck);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment