Created
July 25, 2015 23:52
-
-
Save willeccles/d1691ece933fcba6b903 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
/// test #1 | |
#define u using | |
#define n namespace | |
#define s std | |
// so can this work? | |
u n s; | |
// yes indeed it can! | |
/// test #2 | |
#define spit return | |
// does it work? | |
int meaningOfLife() { | |
spit 42; | |
} | |
// meaningOfLife() returns 42 | |
/// test #3 - let's go more in depth. | |
#define thing int | |
#define methodName meaningOfLife() | |
#define answer 42 | |
// let's test it: | |
thing methodName { | |
// we defined spit before so I didn't redefine it | |
spit answer; | |
} | |
// that returns 42! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment