# t00052 - Test case for template methods rendering
## Config
```yaml
compilation_database_dir: ..
output_directory: puml
diagrams:
  t00052_class:
    type: class
    glob:
      - ../../tests/t00052/t00052.cc
    include:
      namespaces:
        - clanguml::t00052
    using_namespace:
      - clanguml::t00052
```
## Source code
File t00052.cc
```cpp
#include <cmath>

namespace clanguml {
namespace t00052 {

class A {
public:
    template <typename T> T a(T p) { return p; }

    template <typename F, typename Q> void aa(F &&f, Q q) { f(q); }
};

template <typename T> class B {
public:
    T b(T t) { return t; }

    template <typename F> T bb(F &&f, T t) { return f(t); }
};

template <typename T> class C {
    template <typename P> T c(P p) { return static_cast<T>(p); }
};

template <> template <> int C<int>::c<double>(double p)
{
    return std::floor(p);
}

struct R {
    A a;
    B<int> b;
    C<int> c;
};
}
}
```
## Generated UML diagrams
![t00052_class](./t00052_class.svg "Test case for template methods rendering")
## Generated JSON models
```json
{
  "diagram_type": "class",
  "elements": [
    {
      "bases": [],
      "display_name": "clanguml::t00052::A",
      "id": "2200853067459698271",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": false,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "a",
          "parameters": [
            {
              "name": "p",
              "type": "T"
            }
          ],
          "type": "T"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "aa",
          "parameters": [
            {
              "name": "f",
              "type": "F &&"
            },
            {
              "name": "q",
              "type": "Q"
            }
          ],
          "type": "void"
        }
      ],
      "name": "A",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 6
      },
      "template_parameters": [],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00052::B<T>",
      "id": "1737293776724790064",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "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": false,
          "is_virtual": false,
          "name": "b",
          "parameters": [
            {
              "name": "t",
              "type": "T"
            }
          ],
          "type": "T"
        },
        {
          "access": "public",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "bb",
          "parameters": [
            {
              "name": "f",
              "type": "F &&"
            },
            {
              "name": "t",
              "type": "T"
            }
          ],
          "type": "T"
        }
      ],
      "name": "B",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 13
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00052::C<T>",
      "id": "687756639884832524",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [
        {
          "access": "private",
          "is_const": false,
          "is_defaulted": false,
          "is_implicit": false,
          "is_pure_virtual": false,
          "is_static": false,
          "is_virtual": false,
          "name": "c",
          "parameters": [
            {
              "name": "p",
              "type": "P"
            }
          ],
          "type": "T"
        }
      ],
      "name": "C",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 20
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "template_type",
          "name": "T",
          "template_parameters": []
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00052::B<int>",
      "id": "1043027222809675776",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "B",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 13
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "argument",
          "template_parameters": [],
          "type": "int"
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00052::C<int>",
      "id": "492968837554438176",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": false,
      "is_template": true,
      "is_union": false,
      "members": [],
      "methods": [],
      "name": "C",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 20
      },
      "template_parameters": [
        {
          "is_variadic": false,
          "kind": "argument",
          "template_parameters": [],
          "type": "int"
        }
      ],
      "type": "class"
    },
    {
      "bases": [],
      "display_name": "clanguml::t00052::R",
      "id": "1157978668683299226",
      "is_abstract": false,
      "is_nested": false,
      "is_struct": true,
      "is_template": false,
      "is_union": false,
      "members": [
        {
          "access": "public",
          "is_static": false,
          "name": "a",
          "source_location": {
            "file": "../../tests/t00052/t00052.cc",
            "line": 30
          },
          "type": "clanguml::t00052::A"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "b",
          "source_location": {
            "file": "../../tests/t00052/t00052.cc",
            "line": 31
          },
          "type": "B<int>"
        },
        {
          "access": "public",
          "is_static": false,
          "name": "c",
          "source_location": {
            "file": "../../tests/t00052/t00052.cc",
            "line": 32
          },
          "type": "C<int>"
        }
      ],
      "methods": [],
      "name": "R",
      "namespace": "clanguml::t00052",
      "source_location": {
        "file": "../../tests/t00052/t00052.cc",
        "line": 29
      },
      "template_parameters": [],
      "type": "class"
    }
  ],
  "metadata": {
    "clang_uml_version": "0.3.5-27-g81c7ce7",
    "llvm_version": "Ubuntu clang version 15.0.6",
    "schema_version": 1
  },
  "name": "t00052_class",
  "relationships": [
    {
      "access": "public",
      "destination": "1737293776724790064",
      "source": "1043027222809675776",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "687756639884832524",
      "source": "492968837554438176",
      "type": "instantiation"
    },
    {
      "access": "public",
      "destination": "2200853067459698271",
      "label": "a",
      "source": "1157978668683299226",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "1043027222809675776",
      "label": "b",
      "source": "1157978668683299226",
      "type": "aggregation"
    },
    {
      "access": "public",
      "destination": "492968837554438176",
      "label": "c",
      "source": "1157978668683299226",
      "type": "aggregation"
    }
  ],
  "using_namespace": "clanguml::t00052"
}
```
