I have a problem when I declare template class inside another a template class.
#pragma once
template<typename T>
class D<T>;//error 1,2
template<typename T>
class B
{
D* d;
public:
B(void){
}
~B(void){
}
};
#pragma once
#include<iostream>
using namespace std;
template<typename T>
class B<T>;// error 3
template<typename T>
class D
{
B* b;
public:
D(void){
}
~D(void){
}
};
the error message is
Error 1 error C2143: syntax error : missing ';' before '<'
Error 2 error C2059: syntax error : '<'
Error 3 error C2753: 'B<T>' : partial specialization cannot match argument list for primary template
any help will be appreciated.