Open jcxz opened 3 years ago
I had a similar issue, which looks a bit like this:
template<int i>
class Foo{};
// [...]
rttr::type const foo0Type = rttr::type::get<Foo<0>>(); // same compiler error as OP here
I am also having this issue. Are there any workarounds or fixes for it?
Found a workaround by using a wrapper that hides the original template class:
#include <rttr/registration>
#include <rttr/type>
template <bool b>
class C1Tpl { };
using C1 = C1Tpl<false>;
struct param { };
template <typename T>
class C2Tpl { };
using C2 = C2Tpl<param>;
struct Wrapper { C1 c1; };
RTTR_REGISTRATION
{
//rttr::registration::class_<C1>("C1"); // fails to compile
//rttr::registration::class_<C1Tpl<false>>("C1"); // fails to compile
rttr::registration::class_<C2>("C2");
// workaround:
rttr::registration::class_<Wrapper>("C1");
}
int main()
{
return 0;
}
The following code fails to compile:
Compilation log:
It looks like RTTR wrongly handles non-template arguments (
false
). It tries to callrttr::type::get<false>()
.