The tuple in c++11 is an n-ary variable tuple, which is equivalent to a struct with n elements, except that the members of the struct are anonymous, and a Get () method is provided in the tuple to get the value of the element corresponding to the subscript. You can also construct a tuple object by using the Make_tuple () method. The specific usage is as follows
We know that the number of elements in a tuple is indeterminate, and the type of each element is specified by a template parameter, so how does a tuple do that? The answer is to use a mutable parameter template. In C + +, we have used the printf function, whose arguments are mutable, and also allow the parameters of the template to be mutable in c++11. As an example, the following code is the number of arguments
All right, here we go, Mayuyu. Implements a print function that represents all values of the output variable parameter list. As follows
More information: please poke here
http://en.cppreference.com/w/cpp/utility/tuple
Tuple and variable parameter templates in c++11