54 lines
1.0 KiB
Markdown
54 lines
1.0 KiB
Markdown
# t20009 - Smart pointer dereference call expression test case
|
|
## Config
|
|
```yaml
|
|
compilation_database_dir: ..
|
|
output_directory: puml
|
|
diagrams:
|
|
t20009_sequence:
|
|
type: sequence
|
|
glob:
|
|
- ../../tests/t20009/t20009.cc
|
|
include:
|
|
namespaces:
|
|
- clanguml::t20009
|
|
using_namespace:
|
|
- clanguml::t20009
|
|
start_from:
|
|
- function: "clanguml::t20009::tmain()"
|
|
```
|
|
## Source code
|
|
File t20009.cc
|
|
```cpp
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace clanguml {
|
|
namespace t20009 {
|
|
template <typename T> struct A {
|
|
void a(T arg) { }
|
|
};
|
|
|
|
template <typename T> struct B {
|
|
void b(T arg) { a->a(arg); }
|
|
|
|
std::unique_ptr<A<T>> a;
|
|
};
|
|
|
|
using BFloatPtr = std::shared_ptr<B<float>>;
|
|
|
|
void tmain()
|
|
{
|
|
std::shared_ptr<B<std::string>> bstring;
|
|
auto bint = std::make_unique<B<int>>();
|
|
BFloatPtr bfloat;
|
|
|
|
bstring->b("b");
|
|
bint.get()->b(42);
|
|
bfloat->b(1.0);
|
|
}
|
|
}
|
|
}
|
|
```
|
|
## Generated UML diagrams
|
|

|