ext-cryptopp/TestPrograms/test_cxx11_constexpr.cxx
2020-08-06 00:39:40 -04:00

11 lines
148 B
C++

constexpr int fact(int n)
{
return n <= 1 ? 1 : (n * fact(n - 1));
}
int main(int argc, char* argv[])
{
fact(4);
return 0;
}