以下不编译,我不能为我的生活看到为什么!使用列表/迭代器愚蠢编译错误(C++)
#include <list>
using namespace std;
list<char> myList;
list<int>::iterator it;
it = myList.begin();
错误:
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::list<_Ty>::_Iterator<_Secure_validation>' (or there is no acceptable conversion)
注意模板相关的错误,微软编译器会在错误消息后行打印模板参数。所以下一行将包含'with [Ty_ = int]和[Ty_ = char]'。 – MP24 2009-10-28 15:58:01