#include <iostream>
#include <string>
#include <tuple>
using namespace std;
tuple<int,float,string> func(int a, float b,string s) {
return make_tuple(a,b,s);
}
//输出函数
void Print(tuple<int, float, string> t) {
cout << get<0>(t) << " ";
cout << get<1>(t) << " ";
cout << get<2>(t) << " ";
cout << endl;
}
int main() {
tuple<int, float, string> t = func(1314, 520, "coolsunxu");
auto t1= func(1314, 520, "coolsunxu");
Print(t);
Print(t1);
system("pause");
return 0;
}
C++标准库tuple小例
最新推荐文章于 2024-08-13 23:36:44 发布