- Solution
Let's have a look at a solution review for the last exercise.
We'll cover the following...
Solution Review
Press + to interact
// templateFactorial.cpp#include <iostream>template <int N>struct Factorial{static int const value = N * Factorial<N-1>::value;};template <>struct Factorial<1>{static int const value = 1;};int main(){std::cout << Factorial<10>::value << std::endl;}
Explanation
The Factorial
function ...