我有以下内容:
map<boost::tuple<int, string>, int> edges;
edges[boost::make_tuple(1, "a")] = 1;
一个简单的cout << edges[boost::make_tuple(1, "a")] << endl;
确认它是1;
我该如何迭代呢?以下似乎不起作用:
typedef map<boost::tuple<int, string>, int>::iterator it_type;
for(it_type i = edges.begin(); i != edges.end(); i++) {
cout << i->first << endl;
}
谢谢!