Updated test case documentation

This commit is contained in:
Bartek Kryza
2022-12-10 16:37:28 +01:00
parent 310f311232
commit dae8513529
82 changed files with 3049 additions and 2451 deletions

View File

@@ -27,16 +27,23 @@ namespace t20018 {
template <int N> struct Factorial {
static const int value = N * Factorial<N - 1>::value;
static void print() { Factorial<N - 1>::print(); }
static void print(int answer) { Factorial<N - 1>::print(answer); }
};
template <> struct Factorial<0> {
static const int value = 1;
static void print() { std::cout << "Hello world\n"; }
static void print(int answer)
{
std::cout << "The answer is " << answer << "\n";
}
};
void tmain() { Factorial<5>::print(); }
template <typename T, int N = T::value> struct Answer {
static void print() { T::print(N); }
};
void tmain() { Answer<Factorial<5>>::print(); }
}
}
```