Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/utility/tuple/make tuple"

From cppreference.com
< cpp‎ | utility‎ | tuple
m (wrong header)
m (see-also)
Line 44: Line 44:
  
 
{{dcl list begin}}
 
{{dcl list begin}}
{{dcl list tfun | cpp/utility/tuple/tie | creates a {{tt|tuple}} of lvalue references or unpacks a tuple into individual objects }}
+
{{dcl list template | cpp/utility/tuple/dcl list tie}}
{{dcl list tfun | cpp/utility/tuple/forward_as_tuple | creates a {{tt|tuple}} of rvalue references }}
+
{{dcl list template | cpp/utility/tuple/dcl list forward_as_tuple}}
 +
{{dcl list template | cpp/utility/tuple/dcl list tuple_cat}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 13:19, 30 August 2011

Template:cpp/utility/tuple/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <tuple>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
template< class... Types >
tuple<VTypes...> make_tuple(Types&&... args);
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Creates a tuple object, deducing the target type from the types of arguments. The deduced types are Template:cpp (transformed as if passed to a function by value) unless application of Template:cpp results in Template:cpp for some type X, in which case the deduced type is is X&.

Parameters

args - zero or more arguments to construct the tuple from

Return value

A Template:cpp/ltt object containing the given values.

Example

Template:example cpp

(C++11)
creates a tuple of lvalue references or unpacks a tuple into individual objects
(function template) [edit]
creates a tuple of forwarding references
(function template) [edit]
(C++11)
creates a tuple by concatenating any number of tuples
(function template) [edit]