Created
June 3, 2017 14:56
-
-
Save Sora1248/757bd5140dde16364e21325c56dd33de to your computer and use it in GitHub Desktop.
Working Version of BMW Karriere's strange C++ String.
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
// http://devhumor.com/media/quot-automobile-history-in-written-in-c-nowaday-quot | |
#include <iostream> | |
template<char... Cs> | |
class String { | |
public: | |
static char Function() { | |
const char str[] = { Cs..., 0 }; | |
std::cout << str << std::endl; | |
return str[0]; | |
} | |
}; | |
int main() | |
{ | |
static const char S = String<'S','H','A','R','E','Y','O','U','R','P','A','S','S','I','O','N'>::Function(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment