C++17

» C++

记录一些C++17新特性(呜呜,很多编译器都还没支持)

函数返回多个返回值

//例子
std::tuple<int, int>func()
{
	return std::make_tuple(1, 2);
}
auto [a, b] = func(); //声明并定义了俩个int变量, a = 1, b = 2

auto [a, b] = c; 这种语法叫做结构化绑定,就要提到c++11中的tie函数

//定义:创建左值引用的tuple,或将tuple解包为独立对象
//1、创建左值引用的tuple
//2、将tuple解包为独立对象