Last active
August 18, 2016 09:59
-
-
Save dascandy/ede4ba88c20ce5523eee303fe9748571 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 <stdio.h> | |
| const char* GetCompilerVersion() { | |
| return "GCC/Clang (working)"; | |
| } | |
| template <typename T> | |
| class X { | |
| public: | |
| static const char* GetCompilerVersion() { | |
| return "MSVC (broken)"; | |
| } | |
| }; | |
| template <typename T> | |
| class Y : public X<T> { | |
| public: | |
| const char* GetCompiler() { | |
| return GetCompilerVersion(); | |
| } | |
| }; | |
| int main() { | |
| printf("using compiler %s\n", Y<int>().GetCompiler()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment