// small program demonstrating computation of factorial by TMP #include template struct Factorial { static const int value = Factorial::value * N; }; template <> struct Factorial<1> { static const int value = 1; }; int main() { std::cout << Factorial<10>::value << std::endl; // this does not work!!! : // int i=5; std::cout << Factorial::value << std::endl; }