We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80e215a commit 62148cfCopy full SHA for 62148cf
1 file changed
section1/test04.cpp
@@ -14,6 +14,8 @@
14
template<int N>
15
struct fib
16
{
17
+ static_assert(N >= 0, "N must be postive");
18
+
19
static const int value =
20
fib<N - 1>::value + fib<N - 2>::value;
21
};
@@ -110,6 +112,7 @@ int main()
110
112
111
113
cout << fib<2>::value << endl;
114
cout << fib<3>::value << endl;
115
+ cout << fib<4>::value << endl;
116
cout << fib<5>::value << endl;
117
118
old_func();
0 commit comments