赞
踩
#include <iostream>
#include <tuple>
#include<vector>
using std::cout ;
using std::endl ;
using std::tuple;
using std::vector;
using std::string;
using std::get;
using std::make_tuple ;
auto handleCmd()
{
auto t1 = make_tuple(1, "a1", "b1", "c1");
cout << get<0>(t1) << " ";
cout << get<1>(t1) << " ";
cout << get<2>(t1) << " ";
cout << get<3>(t1) << " ";
cout << endl;
vector<tuple<int, string, string, string> > tv;
tv.push_back(make_tuple(1, "a1", "b1", "c1"));
tv.push_back(make_tuple(2, "a2", "b2", "c2"));
vector< tuple<int, string, string ,string> >::iterator itr;
for (itr=tv.begin(); itr!=tv.end(); itr++)
{
cout << get<0>(*itr) << " ";
cout << get<1>(*itr) << " ";
cout << get<2>(*itr) << " ";
cout << get<3>(*itr) << endl;
}
return t1;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。