# t20007 - Class template variadic argument list sequence diagram ## Config ```yaml compilation_database_dir: .. output_directory: puml diagrams: t20007_sequence: type: sequence glob: - ../../tests/t20007/t20007.cc include: namespaces: - clanguml::t20007 using_namespace: - clanguml::t20007 start_from: - function: "clanguml::t20007::tmain()" ``` ## Source code File t20007.cc ```cpp #include #include namespace clanguml { namespace t20007 { template struct Adder { First add(First &&arg, Args &&...args) { return (arg + ... + args); } }; void tmain() { using namespace std::string_literals; Adder adder1; Adder adder2; Adder adder3; [[maybe_unused]] auto res1 = adder1.add(2, 2); [[maybe_unused]] auto res2 = adder2.add(1, 2.0, 3.0); [[maybe_unused]] auto res3 = adder3.add("one"s, "two"s, "three"s); } } } ``` ## Generated UML diagrams ![t20007_sequence](./t20007_sequence.svg "Class template variadic argument list sequence diagram") ## Generated JSON models ```json { "diagram_type": "sequence", "metadata": { "clang_uml_version": "0.3.8-29-gc472792", "llvm_version": "Ubuntu clang version 15.0.7", "schema_version": 1 }, "name": "t20007_sequence", "participants": [ { "id": "622662006747239840", "name": "clanguml::t20007::tmain()", "source_location": { "column": 6, "file": "../../tests/t20007/t20007.cc", "line": 11, "translation_unit": "../../tests/t20007/t20007.cc" }, "type": "function" }, { "id": "1742497005509009302", "name": "clanguml::t20007::Adder", "source_location": { "column": 52, "file": "../../tests/t20007/t20007.cc", "line": 7, "translation_unit": "../../tests/t20007/t20007.cc" }, "type": "class" }, { "id": "599640474306956868", "name": "clanguml::t20007::Adder", "source_location": { "column": 52, "file": "../../tests/t20007/t20007.cc", "line": 7, "translation_unit": "../../tests/t20007/t20007.cc" }, "type": "class" }, { "id": "228191787514523926", "name": "clanguml::t20007::Adder", "source_location": { "column": 52, "file": "../../tests/t20007/t20007.cc", "line": 7, "translation_unit": "../../tests/t20007/t20007.cc" }, "type": "class" } ], "sequences": [ { "messages": [ { "from": { "activity_id": "622662006747239840", "activity_name": "clanguml::t20007::tmain()", "participant_id": "622662006747239840", "participant_name": "clanguml::t20007::tmain()" }, "name": "add(int &&,int &&)", "return_type": "int", "scope": "normal", "source_location": { "column": 34, "file": "../../tests/t20007/t20007.cc", "line": 19, "translation_unit": "../../tests/t20007/t20007.cc" }, "to": { "activity_id": "438133719207269065", "activity_name": "clanguml::t20007::Adder::add(int &&,int &&)", "participant_id": "1742497005509009302" }, "type": "message" }, { "from": { "activity_id": "622662006747239840", "activity_name": "clanguml::t20007::tmain()", "participant_id": "622662006747239840", "participant_name": "clanguml::t20007::tmain()" }, "name": "add(int &&,float &&,double &&)", "return_type": "int", "scope": "normal", "source_location": { "column": 34, "file": "../../tests/t20007/t20007.cc", "line": 20, "translation_unit": "../../tests/t20007/t20007.cc" }, "to": { "activity_id": "9522724767688870", "activity_name": "clanguml::t20007::Adder::add(int &&,float &&,double &&)", "participant_id": "599640474306956868" }, "type": "message" }, { "from": { "activity_id": "622662006747239840", "activity_name": "clanguml::t20007::tmain()", "participant_id": "622662006747239840", "participant_name": "clanguml::t20007::tmain()" }, "name": "add(std::string &&,std::string &&,std::string &&)", "return_type": "std::basic_string", "scope": "normal", "source_location": { "column": 34, "file": "../../tests/t20007/t20007.cc", "line": 21, "translation_unit": "../../tests/t20007/t20007.cc" }, "to": { "activity_id": "384866641042941480", "activity_name": "clanguml::t20007::Adder::add(std::string &&,std::string &&,std::string &&)", "participant_id": "228191787514523926" }, "type": "message" } ], "start_from": { "id": 622662006747239840, "location": "clanguml::t20007::tmain()" } } ], "using_namespace": "clanguml::t20007" } ```