Fixed template template example

This commit is contained in:
Bartek Kryza
2021-03-30 00:39:23 +02:00
parent 928e5f5baa
commit d25a252212
3 changed files with 11 additions and 8 deletions

View File

@@ -17,19 +17,18 @@ public:
CMP comparator;
};
/*
* TODO: Handle template template properly.
*
template <typename T> struct Vector {
std::vector<T> values;
};
template <typename T, template <typename> typename C> struct B {
C<T> template_template;
};
struct D {
// libclang claims that the type spelling of 'ints' is 'int'...
B<int, std::vector> ints;
B<int, Vector> ints;
void add(int i) { ints.template_template.push_back(i); }
void add(int i) { ints.template_template.values.push_back(i); }
};
*/
}
}

View File

@@ -43,6 +43,7 @@ TEST_CASE("t00008", "[test-case][class]")
REQUIRE_THAT(puml, StartsWith("@startuml"));
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
REQUIRE_THAT(puml, IsClassTemplate("A", "T, P, bool (*)(int, int), int N"));
REQUIRE_THAT(puml, IsClassTemplate("B", "T, C<>"));
REQUIRE_THAT(puml, IsField(Public("T value")));
REQUIRE_THAT(puml, IsField(Public("T * pointer")));