📜  将地图作为参考传递 c++ 代码示例

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

代码示例1
#include

void function2(std::map &temp_map); //forward declaration

void function1(){
    std::map  my_map; //automatic variable 
                                //no need to make it pointer!
    function2(my_map); 
}

void function2(std::map &temp_map){
    //do stuff with the map
}