Last active
August 29, 2015 14:07
-
-
Save cengiz-io/bb40f9e3139e329e3b7f to your computer and use it in GitHub Desktop.
What the heck is this?
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 bar { | |
int i; | |
}; | |
struct foo { | |
int bar::* p; | |
}; | |
int main() { | |
bar b; | |
b.i = 42; | |
foo f; | |
f.p = &bar::i; | |
int bar::* foo::* ptr = &foo::p; | |
std::cout << (b.*(f.*ptr)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment