boost-ext/reflect

Issues with namespaces and template arguments.

SGSSGene opened this issue · 3 comments

If the argument of a template argument is inside an namespace, the type_name() functionality doesn't return a useful name:

template <typename T> struct A {};
namespace n {
  struct B {};
}

static_assert("B>"sv == reflect::type_name<A<n::B>>()); // unexpectedly passes

or see:

https://godbolt.org/z/3bTErb9j5

Yeah, it's because of find_last_of("::") :/ fixing...

So I pushed the fix for type_name - 57af509. That will now returns A for the case above as the type name by default is the unqualified type_name. I'm planning to add qualified_type_name as a follow-up which will also return fully qualified namespaces.

Closing as the issue is fixed and a new feature will be added as a follow-up.