New Paste :: Recent Pastes:: No Line Numbers
fact meta-prog by CraZyLeGs
1
template<unsigned int N> struct Fact { enum {Value = N * Fact<N - 1>::Value}; }; template<> struct Fact<0> { enum {Value = 1}; }; // x would be 24 before you even launch the program - no overhead unsigned int x = Fact<4>::Value;