使用 g++ 4.6.2 编译下一个代码时出现“15:14:错误:模板参数列表太少”
template <class T>
class A
{
public:
class B
{
public:
class C; //forward declaration
};
class D
{
//using B
};
class B::C // error here
{
//using D
};
//using B::C
};
/* works fine, but required into "A"
template <class T>
class A<T>::B::C
{
public:
};
*/
如何在不改变声明顺序的情况下解决问题?