我刚刚将一个项目从 Visual Studio 2003 转换为 2005,尽管其中大部分都“转换”得很好,但以下行出现了一系列 STL 错误:
void SomeFn( std::vector<CSomeObject*>::iterator it,
std::vector<CSomeObject*>::iterator itBegin = NULL,
std::vector<CSomeObject*>::iterator itEnd = NULL );
Visual Studio 错误如下:
c:\<path>\Headerfile.h(20) : error C2440: 'default argument' : cannot convert from 'int' to 'std::_Vector_iterator<_Ty,_Alloc>'
with
[
_Ty=CObject *,
_Alloc=std::allocator<CObject *>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
我看不出该代码有什么问题,它在 VS 2003 中运行良好。有什么想法吗?