# t00008 - Template and template template relationships
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00008_class:
    type: class
    glob:
      - ../../tests/t00008/t00008.cc
    using_namespace:
      - clanguml::t00008
    include:
      namespaces:
        - clanguml::t00008

```
## Source code
File t00008.cc
```cpp
#include <array>
#include <vector>

namespace clanguml {
namespace t00008 {

using CMP = bool (*)(const int, const int);

template <typename T, typename P = T, CMP = nullptr, int N = 3> class A {
public:
    T value;
    T *pointer;
    T &reference;
    std::vector<P> values;
    std::array<int, N> ints;

    CMP comparator;
};

template <typename T> struct Vector {
    std::vector<T> values;
};

template <typename T, template <typename> typename C> struct B {
    C<T> template_template;
};

struct D {
    B<int, Vector> ints;

    template <typename... Items> D(std::tuple<Items...> * /*items*/) { }

    void add(int i) { ints.template_template.values.push_back(i); }
};

struct E {
    template <typename ET> struct nested_template {
        using DT = ET;

        static DT *get(ET *d) { return d; }
    };
};

template <> struct E::nested_template<char> {
    using DeclType = char;

    static DeclType *getDecl(char *c) { return c; }
};

} // namespace t00008
} // namespace clanguml

```
## Generated UML diagrams
![t00008_class](./t00008_class.svg "Template and template template relationships")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "bases": [],
      "display_name": "clanguml::t00008::A<T,P=T,clanguml::t00008::CMP=nullptr,int N=3>",
      "id": "1657660300852090121",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "value",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 11
          },
          "type": "T"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "pointer",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 12
          },
          "type": "T *"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "reference",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 13
          },
          "type": "T &"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "values",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 14
          },
          "type": "std::vector<P>"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "ints",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 15
          },
          "type": "std::array<int,N>"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "comparator",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 17
          },
          "type": "clanguml::t00008::CMP"
        }
      ],
      "methods": [],
      "name": "A",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 9
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        },
        {
          "default": "T",
          "is_variadic": false,
          "kind": "template_type",
          "name": "P",
          "template_parameters": []
        },
        {
          "default": "nullptr",
          "is_variadic": false,
          "kind": "non_type_template",
          "template_parameters": [],
          "type": "clanguml::t00008::CMP"
        },
        {
          "default": "3",
          "is_variadic": false,
          "kind": "non_type_template",
          "name": "N",
          "template_parameters": [],
          "type": "int"
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::Vector<T>",
      "id": "1677407014842680311",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": true,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "values",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 21
          },
          "type": "std::vector<T>"
        }
      ],
      "methods": [],
      "name": "Vector",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 20
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::B<T,C<>>",
      "id": "1968575752686868237",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": true,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "template_template",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 25
          },
          "type": "C<T>"
        }
      ],
      "methods": [],
      "name": "B",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 24
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        },
        {
          "is_variadic": false,
          "kind": "template_template_type",
          "name": "C<>",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::B<int,clanguml::t00008::Vector>",
      "id": "1449136415707203971",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "B",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 24
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "argument",
          "template_parameters": [],
          "type": "int"
        },
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "clanguml::t00008::Vector",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::D",
      "id": "1562396858816419857",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "ints",
          "source_location": {
            "file": "../../tests/t00008/t00008.cc",
            "line": 29
          },
          "type": "B<int,clanguml::t00008::Vector>"
        }
      ],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "add",
          "parameters": [
            {
              "name": "i",
              "type": "int"
            }
          ],
          "type": "void"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "D",
          "parameters": [
            {
              "name": "",
              "type": "std::tuple<Items...> *"
            }
          ],
          "type": "void"
        }
      ],
      "name": "D",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 28
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::E",
      "id": "1787658457052431115",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "E",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 36
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::E::nested_template<ET>",
      "id": "1549419203490064906",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": true,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": true,
          "is_virtual": false,
          "name": "get",
          "parameters": [
            {
              "name": "d",
              "type": "ET *"
            }
          ],
          "type": "clanguml::t00008::E::nested_template::DT *"
        }
      ],
      "name": "E::nested_template",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 37
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "ET",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00008::E::nested_template<char>",
      "id": "33637089897037832",
      "is_abstract": false,
      "is_nested": true,
      "is_struct": true,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": true,
          "is_virtual": false,
          "name": "getDecl",
          "parameters": [
            {
              "name": "c",
              "type": "char *"
            }
          ],
          "type": "clanguml::t00008::E::nested_template<char>::DeclType *"
        }
      ],
      "name": "E::nested_template",
      "namespace": "clanguml::t00008",
      "source_location": {
        "file": "../../tests/t00008/t00008.cc",
        "line": 44
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "argument",
          "template_parameters": [],
          "type": "char"
        }
      ],
      "type": "class"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t00008_class",
  "relationships": [
    {
      "access": "public",
      "destination": "1968575752686868237",
      "source": "1449136415707203971",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "1449136415707203971",
      "label": "ints",
      "source": "1562396858816419857",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "1787658457052431115",
      "source": "1549419203490064906",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "1787658457052431115",
      "source": "33637089897037832",
      "type": "containment"
    },
    {
      "access": "public",
      "destination": "1549419203490064906",
      "source": "33637089897037832",
      "type": "instantiation"
    }
  ],
  "using_namespace": "clanguml::t00008"
}
```
