Created
February 4, 2011 17:24
-
-
Save silverjam/811411 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <cstdio> | |
struct klass1 | |
{ | |
bool operator!() { return false; } | |
}; | |
struct klass2 | |
{ | |
klass1 operator!() { return klass1(); } | |
}; | |
struct klass3 | |
{ | |
klass2 operator!() { return klass2(); } | |
}; | |
struct klass | |
{ | |
klass3 operator!() { return klass3(); } | |
}; | |
main() | |
{ | |
klass k; | |
bool b = !!!!k; | |
printf("b = %d\n", b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment