進階篇_型別打包專家tuple

Pop_Rain發表於2017-05-03

tuple、get、tie:

tuple<string, unsigned int, double> Human;//Human是新的資料型別
Human hujia("jiawei", 23, 56.23);
vector<Human> vecHuman;
cout<<get<0>(hujia)<<endl;	//output:jiawei

string name;
unsigned int age;
double salary;
tie(name, age, salary) = hujia;	//打包一起賦值 


相關文章