64,282
社区成员
发帖
与我相关
我的任务
分享
template <class T>
struct CLinkerT
{
T *pValue;
CLinkerT *pNext;//此处不写成CLinkerT<T>没有问题,编译通过
};
template <class T>
class CTemplate
{
CLinkerT *m_pNode;//此处不写成CLinkerT<T>没有问题,编译通过
CLinkerT *GetNode();//此处不写成CLinkerT<T>没有问题,编译通过
};
//为什么此处函数的返回值写成CLinkerT时编译不通过
//“use of class template requires template argument list”
template <class T>
CLinkerT<T> *CTemplate<T>::GetNode()
{
return m_pNode;
}