    #include <iostream>

    template <int N>
    struct Factorial {
        enum { value = N * Factorial<N - 1>::value };
    };
     
    template <>
    struct Factorial<0> {
        enum { value = 1 };
    };

    int main()
    {
        auto const f10 = Factorial<10>::value; // done at compile-time
        std::cout << f10 << "\n";              // prints 3628800

        return 0;
    }