introspection: test variadic template type_name

This commit is contained in:
Danny Robson 2020-02-27 08:00:18 +11:00
parent 7c92271296
commit 5d0b75d129

View File

@ -23,8 +23,8 @@ namespace bar {
///////////////////////////////////////////////////////////////////////////////
template <typename ValueT>
struct templated_with_type { ValueT inner; };
template <typename ...ValueT>
struct templated_with_type { };
template <int ValueV>
@ -100,6 +100,12 @@ int main ()
"templated_with_type"
);
tap.expect_eq (
cruft::type_name<templated_with_type<int, int>> (),
std::string_view {"templated_with_type<int, int>"},
"templated_with_type"
);
tap.expect_eq (
cruft::type_name<templated_with_type<templated_with_type<int>>> (),
std::string_view {"templated_with_type<templated_with_type<int> >"},