css_enhanced_waf/thirdparty/cryptopp/TestPrograms/test_cxx11_constexpr.cxx

11 lines
148 B
C++
Raw Normal View History

2020-10-22 20:43:01 +03:00
constexpr int fact(int n)
{
return n <= 1 ? 1 : (n * fact(n - 1));
}
int main(int argc, char* argv[])
{
fact(4);
return 0;
}