我剛剛將一個項目從Visual Studio 2003轉換爲2005,儘管它大部分'轉換'正常,但我有一系列STL錯誤來自以下行:STL遷移問題(VS 2003 - > 2005)
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
我看不出什麼錯碼,它在2003年VS任何想法完美地工作?
很奇怪,我想,似乎是在抱怨NULL作爲默認值。 – kenny 2008-11-12 11:21:23