I'm implementing a pretty complex template-based functionality and I've come to an error that I can't resolve. I've simplified my case to this code:
template <typename Head, typename... T>
struct BaseIsFirst {
using Base = Head;
};
template <typename T, typename D>
struct IAction {
std::enable_if_t<std::is_same<T, D::Base>::value> do_action() {}
};
struct Base;
struct Derived1;
struct Derived2;
typedef BaseIsFirst<Base, Derived1, Derived2> MyBIF;
struct Base : public IAction<Base, MyBIF> { };
struct Derived1 : public Base {};
struct Derived2 : public Base {};
If I try to compile this, I get the error:
'std::is_same': 'D::Base' is not a valid template type argument for parameter '_Ty2'
I see no way to define the used types earlier. Is there a workaround for this, or is it simply not possible?