且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何遍历std :: map< string,int>和std :: vector< int>使用单for循环?

更新时间:2022-03-10 00:54:37

如果您知道两者的长度相同,请使用类似以下内容的

If you know there's both the same length, use something like:

auto vit = begin(value);
auto mit = begin(data);
for (; vit != end(value); ++mit, ++vit) {
    // Use mit and vit
}