I got the following problem. I have two class templates, one inheriting from the other.
Expand|Select|Wrap|Line Numbers
- template<typename T>
- struct M{
- class A{};
- };
- template<typename T>
- class B:public M<T>{
- A a;
- };
Expand|Select|Wrap|Line Numbers
- A a;
Expand|Select|Wrap|Line Numbers
- M<T>::A a;
Expand|Select|Wrap|Line Numbers
- error: ISO C++ forbids declaration of ‘A’ with no type
- error: expected ‘;’ before ‘a’
1. Is there any way to use the A class in my B class?
2. I have read that for non-type members of the class template M I can use the "using" declaration inside the child class to be able to use it like its own member. Is there anything I like this for type-members like class A?
I would gratefully appreciate any help.
~<><~~~~~~~ presencia