header
<tuple>
Tuple library
Tuples are objects that pack elements of -possibly- different types together in a single object, just like pair objects do for pairs of elements, but generalized for any number of elements.
Conceptually, they are similar to plain old data structures (C-like structs) but instead of having named data members, its elements are accessed by their order in the tuple.
The selection of particular elements within a tuple is done at the template-instantiation level, and thus, it must be specified at compile-time, with helper functions such as get and tie.
The tuple class is closely related to the pair class (defined in header <utility>): Tuples can be constructed from pairs, and pairs can be treated as tuples for most purposes.
array containers also have certain tuple-like functionalities.
Global functions
Object creation
- make_tuple
- Make tuple (function template
)
- forward_as_tuple
- Forward as tuple (function template
)
- tie
- Tie arguments to tuple elements (function template
)
- tuple_cat
- Concatenate tuples (function template
)
Element access
- get
- Get element (function template
)
Overloads
- relational operators
- Global relational operator functions for tuple (function template
)
- swap (tuple)
- Exchanges the contents of two tuples (function template
)
classes:
global functions:
objects: