Skip to content

Instantly share code, notes, and snippets.

@Sora1248
Created June 3, 2017 14:56
Show Gist options
  • Save Sora1248/757bd5140dde16364e21325c56dd33de to your computer and use it in GitHub Desktop.
Save Sora1248/757bd5140dde16364e21325c56dd33de to your computer and use it in GitHub Desktop.
Working Version of BMW Karriere's strange C++ String.
// 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