Created
August 23, 2016 12:53
-
-
Save valbok/e69642a4f43a057053df6b84a3594b75 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
#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