条款48:认识 template 元编程
template<unsigned n>
struct Factorial {
enum { value = n * Factorial<n-1>::value };
};
template<>
struct Factorial<0>
enum { value = 1 };
};Last updated
template<unsigned n>
struct Factorial {
enum { value = n * Factorial<n-1>::value };
};
template<>
struct Factorial<0>
enum { value = 1 };
};Last updated