My question might not be as clear as I would like. Let me explain. I have an abstract mother class M, and a lot of child class C1,C2,...Cn. In each child, I have to define template types like this:
class Child1 : public Mother
{
public:
typedef AnotherTemplateClass<Child1,int> Type1_C1;
typedef AnotherTemplateClass<Child1,bool> Type2_C1;
typedef AnotherTemplateClass<Child1,unsigned> Type3_C1;
void DoSomething(Type1_C1 a, Type2_C1 b, Type3_C1);
};
I would like to define something like:
class Mother
{
public:
typedef AnotherTemplateClass<this,int> Type1_M;
typedef AnotherTemplateClass<this,bool> Type2_M;
typedef AnotherTemplateClass<this,unsigned> Type3_M;
};
and with Child1 using this type
class Child1 : public Mother
{
void DoSomething(Type1_M a, Type2_M b, Type3_M c);
};
I know that is not possible to do that
error: invalid use of ‘this’ at top level
but is there any syntax that could answer this problem?
is that even possible?