Updated test case documentation
This commit is contained in:
49
docs/test_cases/t20007.md
Normal file
49
docs/test_cases/t20007.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# 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 <string>
|
||||
#include <utility>
|
||||
|
||||
namespace clanguml {
|
||||
namespace t20007 {
|
||||
|
||||
template <typename First, typename... Args> struct Adder {
|
||||
First add(First &&arg, Args &&...args) { return (arg + ... + args); }
|
||||
};
|
||||
|
||||
void tmain()
|
||||
{
|
||||
using namespace std::string_literals;
|
||||
|
||||
Adder<int, int> adder1;
|
||||
Adder<int, float, double> adder2;
|
||||
Adder<std::string, std::string, std::string> 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
|
||||

|
||||
Reference in New Issue
Block a user