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

Posted the_tops ----

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于C++中map的一点疑惑...的主要内容,如果未能解决你的问题,请参考以下文章