📜  对于自动映射 C - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:54.809000             🧑  作者: Mango

代码示例1
//Since c++11
for (const auto& kv : myMap) {
    cout << kv.first << " has value " << kv.second << endl;
}
//Since c++17
for (auto& [key, value]: myMap) {
    cout << key << " has value " << value << endl;
}