I am actually fairly certain the answer to my problem can be found in one of the previously created threads. In particular, Where and why do I have to put the "template" and "typename" keywords? which has a great explanation on template/typename disambiguation. I am however at a loss because I am not actually able to extend the concept to my code which is class templates that interact with each other.
In this thread, I think I see the same error as I get in my code. Why is the answer to define the typedef using A<B>
where B is the class, as opposed to A<T>
where T is the typename template we actually want to have.
Nevertheless, I have tried these options to no avail. Here is the code. Thank you for your help.
#include "testTemplateA.h"
template<typename A>
class testTemplateB {
public:
// none of these work
typedef testTemplateA<A> templateType;
typedef typename testTemplateA<A> templateType;
typedef typename testTemplateA<testTemplateB> templateType;
testTemplateB(templateType& TA) {}
~testTemplateB(void) {}
};
#include "testTemplateB.h"
template<typename A>
class testTemplateA
{
public:
testTemplateA(void) {}
~testTemplateA(void) {}
void callUponB(void) {
testTemplateB<A> g = testTemplateB<A>(this);
}
};