I have a quick question about item 48 in Scott Meyers' "Effective C++". I just don't understand the code copied from the book below,
    #include <iostream>
    using namespace std;
    template <unsigned n>
    struct Factorial
    {
       enum { value=n*Factorial<n-1>::value };
    };
    template <>
    struct Factorial<0>
    {
        enum { value=1};
    };
    int main()
    {
        cout<<Factorial<5>::value<<endl;
        cout<<Factorial<10>::value<<endl;
    }
Why do I have to use enum in template programming? Is there an alternative way to do this? Thanks for the help in advance.
                        
You can use
static const intas Nawaz says. I guess the reason Scott Myers uses an enum is that compiler support for in-class initialization of static const integers was a bit limited when he wrote the book. So an enum was a safer option.