📜  c++ map 循环遍历键值 - C++ 代码示例

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

代码示例3
#include 
#include 

int main() {
    std::map myMap;

    myMap["one"] = 1;
    myMap["two"] = 2;
    myMap["three"] = 3;

    for ( const auto &[key, value]: myMap ) {
        std::cout << key << '\n';
    }
}