Created
June 25, 2012 18:12
-
-
Save caryhaynie/2990287 to your computer and use it in GitHub Desktop.
Example
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
| template <typename T> | |
| class BasePlatform {}; | |
| class SDLPlatform : BasePlatform<SDLPlatform> {}; | |
| class Win32Platform : BasePlatform<Win32Platform> {}; | |
| #ifdef USE_WINDERS | |
| typedef Win32Platform Platform; | |
| #else | |
| typedef SDLPlatform Platform; | |
| #endif | |
| // Then the user just calls: | |
| // Platform p; | |
| // and gets the correct thing at compile time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment