D
dwrayment
here is an example of what im trying to do in the most basic form,
template<class T, class I> class A : public T {
typedef struct {I i; T t;} e;
// functions not that important, not the issue
}
struct {... } typea;
struct {... } typeb;
A<type,int> _a;
A<typea,int> _b;
Problem: when instantiating _b, entry.T is of the form typea
and not typeb. so when i try doing something like
entry.T = (T &)(*this) it produces cannot convert
from typea to typeb and vice versa.
I have also tried just declaring struct e without typedef and the same thing
happens. I think the solution involves the keyword
typename but Im having trouble figureing it out.
If anyone can help id appreciate it. Thanks
template<class T, class I> class A : public T {
typedef struct {I i; T t;} e;
// functions not that important, not the issue
}
struct {... } typea;
struct {... } typeb;
A<type,int> _a;
A<typea,int> _b;
Problem: when instantiating _b, entry.T is of the form typea
and not typeb. so when i try doing something like
entry.T = (T &)(*this) it produces cannot convert
from typea to typeb and vice versa.
I have also tried just declaring struct e without typedef and the same thing
happens. I think the solution involves the keyword
typename but Im having trouble figureing it out.
If anyone can help id appreciate it. Thanks