Roy*_*lov 1 c++ iterator multimap
我正在使用多图stl,我迭代我的地图,我没有在地图中找到我想要的对象,现在我想检查我的迭代器是否持有我想要的东西,我有困难因为它它不是空的或什么的.感谢名单!
如果它找不到你想要的东西那么它应该等于end()容器方法返回的迭代器.
所以:
iterator it = container.find(something);
if (it == container.end())
{
//not found
return;
}
//else found
Run Code Online (Sandbox Code Playgroud)