CTypedPtrList使用的问题
照着教程做的例子,在工程的类中定义了 CTypedPtrList<CObject,CCommodity*>m_list;
(CCommodity是自定义的基于COject的一个类)
并需要执行 m_list.IsEmpty() 和 m_list.GetTailPosition()
但编译出现了下面的错误(stdafx.h中添加了#include<afxtempl.h>):
:\microsoft visual studio\mfc\include\afxtempl.h(1566) : error C2664: '__thiscall CObject::CObject(const class CObject &)' : cannot convert parameter 1 from 'int' to 'const class CObject &'
Reason: cannot convert from 'int' to 'const class CObject'
No constructor could take the source type, or constructor overload resolution was ambiguous
f:\microsoft visual studio\mfc\include\afxtempl.h(1566) : while compiling class-template member function '__thiscall _CTypedPtrList<class CObject,class CCommodity *>::_CTypedPtrList<class CObject,class CCommodity *>(int)
和'IsEmpty' : is not a member of 'CTypedPtrList<class CObject,class CCommodity *>'这样的错误
有什么解决的办法??