Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/148.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在地图上迭代<;boost::tuple<;int,string>;,int>;在C++;_C++_Boost_Map_Iterator_Tuples - Fatal编程技术网

C++ 在地图上迭代<;boost::tuple<;int,string>;,int>;在C++;

C++ 在地图上迭代<;boost::tuple<;int,string>;,int>;在C++;,c++,boost,map,iterator,tuples,C++,Boost,Map,Iterator,Tuples,我有以下资料: map<boost::tuple<int, string>, int> edges; edges[boost::make_tuple(1, "a")] = 1; 映射边缘; 边[boost::make_tuple(1,“a”)]=1; 一个简单的couti->first是一个元组。因此,你不能仅仅是coutit 请参阅以了解如何访问元组 您可以使用i->second,因为它是int,因此您可以使用cout使用它。i->first是一个元组。因此,你不能

我有以下资料:

map<boost::tuple<int, string>, int> edges;
edges[boost::make_tuple(1, "a")] = 1;
映射边缘;
边[boost::make_tuple(1,“a”)]=1;

一个简单的
cout
i->first
是一个
元组。因此,你不能仅仅是
cout
it

请参阅以了解如何访问元组


您可以使用
i->second
,因为它是
int
,因此您可以使用
cout
使用它。

i->first
是一个
元组。因此,你不能仅仅是
cout
it

请参阅以了解如何访问元组


你可以使用
i->second
,因为它是
int
,因此你可以使用
cout
使用它。

你的意思是
i->second
?你的意思是
i->second
typedef  map<boost::tuple<int, string>, int>::iterator it_type;
for(it_type i = edges.begin(); i != edges.end(); i++) {
     cout << i->first << endl;
}