Files
clang-uml/docs/test_cases/t00014.md

90 lines
1.7 KiB
Markdown

# t00014 - Alias template instantiation
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
t00014_class:
type: class
glob:
- ../../tests/t00014/t00014.cc
using_namespace:
- clanguml::t00014
include:
namespaces:
- clanguml::t00014
exclude:
namespaces:
- std
- clanguml::t00014::std
```
## Source code
File t00014.cc
```cpp
#include <algorithm>
#include <functional>
#include <ios>
#include <map>
#include <numeric>
#include <string>
#include <type_traits>
#include <variant>
#include <vector>
/**
* These should not be include as they are not
* in ns clanguml::t00014
*/
template <typename T> struct clanguml_t00014_A {
T value;
};
using clanguml_t00014_AString = clanguml_t00014_A<std::string>;
namespace clanguml {
namespace t00014 {
template <typename T, typename P> struct A {
T t;
P p;
};
template <typename T> using AString = A<T, std::string>;
template <typename... T> using GeneralCallback = std::function<void(T..., int)>;
using VoidCallback = GeneralCallback<>;
struct B {
std::string value;
};
using BVector = std::vector<B>;
using BVector2 = BVector;
using AIntString = AString<int>;
using AStringString = AString<std::string>;
using BStringString = AStringString;
class R {
// clang-uml: tinst A<T, std::string>
A<bool, std::string> boolstring;
AString<float> floatstring;
AIntString intstring;
AStringString stringstring;
protected:
BVector bs;
public:
BVector2 bs2;
GeneralCallback<AIntString> cb;
VoidCallback vcb;
};
}
}
```
## Generated UML diagrams
![t00014_class](./t00014_class.svg "Alias template instantiation")