Calculating and printing factorial at compile time in C++

前端 未结 4 820
逝去的感伤
逝去的感伤 2020-12-01 12:34
template
struct Factorial {
    enum { value = n * Factorial::value};
};

template<>
struct Factorial<0> {
    enum {val         


        
4条回答
  •  时光说笑
    2020-12-01 13:01

    There is definitely no standard way. I can't think of a compiler-specific way, either.

    [[Filler]]

提交回复
热议问题