#include // primary template template struct Fib { static int const value = Fib::value + Fib::value; }; // specializations to stop recursion // specialization is indicated template<> struct Fib<0> { static int const value = 0; }; template<> struct Fib<1> { static int const value = 1; }; using namespace std; int main() { cut << Fib<8>::value << endl; return 0; } }