Updated test case documentation
This commit is contained in:
54
docs/test_cases/t20006.md
Normal file
54
docs/test_cases/t20006.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# 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 <string>
|
||||
|
||||
namespace clanguml {
|
||||
namespace t20006 {
|
||||
|
||||
template <typename T> struct A {
|
||||
T a_int(T arg) { return arg + 1; }
|
||||
T a_string(T arg) { return arg + "_string"; }
|
||||
};
|
||||
|
||||
template <typename T> struct B {
|
||||
T b(T arg) { return a_.a_int(arg); }
|
||||
A<T> a_;
|
||||
};
|
||||
|
||||
template <> struct B<std::string> {
|
||||
std::string b(std::string arg) { return a_.a_string(arg); }
|
||||
A<std::string> a_;
|
||||
};
|
||||
|
||||
void tmain()
|
||||
{
|
||||
B<int> bint;
|
||||
B<std::string> bstring;
|
||||
|
||||
bint.b(1);
|
||||
bstring.b("bstring");
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
## Generated UML diagrams
|
||||

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