I have a template class:
template<typename A, typename B>
class A {
};
In another .h file
template<typename A, typename B>
class A; //forward declaration
How could I declare m_A over here? I keep getting C++ forbids declaration of A with no type error:
class B {
A* m_A;
};
If you don’t know the types that you want to instantiate
Awith when inside ofB, then you will have to also make a template out ofBEither that, or you would have to instantiate
Aas a specific type, i.e.,