It's really dumb, but it's my most proud hack:
// meta.C
#include
template <>
inline printN<1>(const char * msg) {
printf("%s", msg);
}
template
inline printN(const char * msg) {
printN<1>(msg);
printN(msg);
}
int main() {
printN<3>("Hello World!\n");
return 0;
}
Points for figuring out what it does; double-plus points for knowing
(
Read more... )