如何在C++中编写可以执行类似地图迭代器的Go代码?
typedef std::map<std::string, MyStruct> MyMap; MyMap::iterator it = myMap.find("key"); if(it!=myMap.end()) { it->v1 = something; it->v2 = something; }
iterator specifications map go
go ×1
iterator ×1
map ×1
specifications ×1