Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Template Meta Programming
//clang 3.7.0 #include <iostream> #include <cassert> template<int i> long int factorial() { return i * factorial<i-1>(); } template<> long int factorial<0>() { return 1; } int main() { constexpr int N = 8; assert(factorial<N>() == 40320); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
appliWall
What's the problem with this?
Dynamic call
pointer to complete array does not convert implicitly to pointer to array of unknown bound
STL stack
Recursive Call Example Sum
Fun with Pointers #1
C++ does not have reference-to-reference types
is_convertible
Division by zero exception example
Please log in to post a comment.