//tuple
std::tuple<int, int, int, int, qstring> thorface::getuserinfotojudgeopendoor(qstring strusercode) { int iunpaidorderlist = 0; int iunhandledorderlist = 0; int istatus = 0; int ibindface = 0; qstring strusername = ""; return std::make_tuple(iunpaidorderlist, iunhandledorderlist, istatus, ibindface, strusername); }
//tie解析
int iunpaidorderlist = 0;
int iunhandledorderlist = 0;
int istatus = -1;
int ibindface = -1;
qstring strusername = "";
std::tie(iunpaidorderlist, iunhandledorderlist, istatus, ibindface, strusername) = getuserinfotojudgeopendoor(strname);
tuple是一个固定大小的不同类型值的集合,是泛化的std::pair。和c#中的tuple类似,但是比c#中的tuple强大得多。我们也可以把他当做一个通用的结构体来用,不需要创建结构体又获取结构体的特征,在某些情况下可以取代结构体使程序更简洁,直观。
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/c-cdevelopment/605390.html