C++中map的一点疑惑...

int CRuntimePara::getInt(const string& strKey,int iDefault)
{
map<string,string>::const_iterator iter;

if ((iter = _mapParaValue.find(strKey)) != _mapParaValue.end())
return atoi((*iter).second.c_str());
else
return iDefault;
}

 

_mapParaValue.end()

-----------------------------------------------------------------------------------------

class CRuntimePara
{

...

private:
std::map<std::string,std::string> _mapParaValue;
};

------------------------------------------------------------------------------------------

_mapParaValue.end()为map里的end的返回置为Returns an iterator referring to the past-the-end element in the map container.返回指向_mapParaValue容器尾元素之后位置的迭代器               若begin == end

 

posted @ 2016-06-30 11:11  the_tops  阅读(188)  评论(0编辑  收藏  举报