本文整理汇总了C++中std::multimap::moveNext方法的典型用法代码示例。如果您正苦于以下问题:C++ multimap::moveNext方法的具体用法?C++ multimap::moveNext怎么用?C++ multimap::moveNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::multimap
的用法示例。
在下文中一共展示了multimap::moveNext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: verifyIterators
/*
* Walk stli and volti as long as key = val.
* Collect all the values, sort those values, and make sure
* that stl and volt returned equal value sets.
* Record cardinality of largest value set evaluated in chainCounter
*/
void verifyIterators(std::multimap<std::string, std::string> &stl,
std::multimap<std::string, std::string>::iterator &stli,
voltdb::CompactingMap<NormalKeyValuePair<std::string, std::string>, StringComparator>::iterator &volti,
std::string val, int *chainCounter)
{
std::vector<std::string> stlv;
std::vector<std::string> voltv;
for (; stli != stl.end(); stli++) {
if (stli->first.compare(val) == 0) {
stlv.push_back(stli->second);
}
else {
break;
}
}
for (;!volti.isEnd(); volti.moveNext()) {
if (volti.key().compare(val) == 0) {
voltv.push_back(volti.value());
}
else {
break;
}
}
ASSERT_TRUE(stlv.size() > 0);
ASSERT_TRUE(stlv.size() == voltv.size());
if (chainCounter && ((int)stlv.size() > (int)*chainCounter)) {
*chainCounter = (int)stlv.size();
}
std::sort(stlv.begin(), stlv.end());
std::sort(voltv.begin(), voltv.end());
for (int i=0; i < stlv.size(); i++) {
ASSERT_TRUE(stlv[i].compare(voltv[i]) == 0);
}
}