# t20008 - Constexpr if sequence diagram test case ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20008_sequence: type: sequence glob: - ../../tests/t20008/t20008.cc include: namespaces: - clanguml::t20008 using_namespace: - clanguml::t20008 start_from: - function: "clanguml::t20008::tmain()" ``` ## Source code File t20008.cc ```cpp #include #include namespace clanguml { namespace t20008 { template struct A { void a1(T arg) { } void a2(T arg) { } void a3(T arg) { } }; template struct B { A a; void b(T arg) { if constexpr (std::is_integral_v) { a.a1(arg); } else if constexpr (std::is_pointer_v) { a.a2(arg); } else { a.a3(arg); } } }; void tmain() { using namespace std::string_literals; B bint; B bcharp; B bstring; bint.b(1); bcharp.b("1"); bstring.b("1"s); } } } ``` ## Generated UML diagrams ![t20008_sequence](./t20008_sequence.svg "Constexpr if sequence diagram test case")