# t20006 - Class template specialization basic sequence diagram ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20006_sequence: type: sequence glob: - ../../tests/t20006/t20006.cc include: namespaces: - clanguml::t20006 using_namespace: - clanguml::t20006 start_from: - function: "clanguml::t20006::tmain()" ``` ## Source code File t20006.cc ```cpp #include namespace clanguml { namespace t20006 { template struct A { T a1(T arg) { return arg; } T a2(T arg) { return arg + arg; } }; template struct B { T b(T arg) { return a_.a1(arg); } A a_; }; template <> struct B { std::string b(std::string arg) { return a_.a2(arg); } A a_; }; template struct AA { void aa1(T t) { } void aa2(T t) { } }; template struct BB { void bb1(T t, F f) { aa_.aa1(t); } void bb2(T t, F f) { aa_.aa2(t); } AA aa_; }; template struct BB { void bb1(T t, std::string f) { aa_->aa2(t); } void bb2(T t, std::string f) { aa_->aa1(t); } BB(AA *aa) : aa_{aa} { } AA *aa_; }; template struct BB { void bb1(T t, float f) { bb2(t, f); } void bb2(T t, float f) { aa_.aa2(t); } BB(AA &aa) : aa_{aa} { } AA &aa_; }; void tmain() { B bint; B bstring; bint.b(1); bstring.b("bstring"); BB bbint; AA aaint; BB bbstring{&aaint}; BB bbfloat{aaint}; bbint.bb1(1, 1); bbint.bb2(2, 2); bbstring.bb1(1, "calling aa2"); bbstring.bb2(1, "calling aa1"); bbfloat.bb1(1, 1.0f); } } } ``` ## Generated UML diagrams ![t20006_sequence](./t20006_sequence.svg "Class template specialization basic sequence diagram")