# t20018 - Recursive template sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20018_sequence: type: sequence glob: - ../../tests/t20018/t20018.cc include: namespaces: - clanguml::t20018 using_namespace: - clanguml::t20018 start_from: - function: "clanguml::t20018::tmain()" ``` ## Source code File t20018.cc ```cpp #include namespace clanguml { namespace t20018 { template struct Factorial { static const int value = N * Factorial::value; static void print(int answer) { Factorial::print(answer); } }; template <> struct Factorial<0> { static const int value = 1; static void print(int answer) { std::cout << "The answer is " << answer << "\n"; } }; template struct Answer { static void print() { T::print(N); } }; void tmain() { Answer>::print(); } } } ``` ## Generated UML diagrams ![t20018_sequence](./t20018_sequence.svg "Recursive template sequence diagram test case")