高手帮忙看看了!
//源程序
template <class elemType>
elemType min2(const vector<elemType> &vec)
{
vector<elemType>::iterator iter=vec.begin();
elemType temp=*iter;
for(;iter!=vec.end();iter++)
if(temp<*iter) temp=*iter;
return temp;
}
//编译出错
c:\Documents and Settings\He.Lotus\My Documents\Visual Studio Projects\VCMFC\e2-23\e2-23.cpp(25): error C2440: “初始化” : 无法从“std::vector<_Ty>::const_iterator”转换为“std::vector<_Ty>::iterator”
with
[
_Ty=int
]
and
[
_Ty=int
]
请问,我的程序什么地方错了?