std::tuple
From cppreference.com
Defined in header <tuple>
|
||
template< class... Types > class tuple; |
(since C++11) | |
Class template std::tuple
is a fixed-size collection of heterogeneous values. It is a generalization of std::pair.
If std::is_trivially_destructible<Ti>::value is true for every Ti
in Types
, the destructor of std::tuple
is trivial.
If a program declares an explicit or partial specialization of std::tuple
, the program is ill-formed, no diagnostic required.
Contents |
[edit] Template parameters
Types... | - | the types of the elements that the tuple stores. Empty list is supported. |
[edit] Member functions
constructs a new tuple (public member function) | |
assigns the contents of one tuple to another (public member function) | |
swaps the contents of two tuple s (public member function) |
[edit] Non-member functions
(C++11) |
creates a tuple object of the type defined by the argument types (function template) |
(C++11) |
creates a tuple of lvalue references or unpacks a tuple into individual objects (function template) |
(C++11) |
creates a tuple of forwarding references (function template) |
(C++11) |
creates a tuple by concatenating any number of tuples (function template) |
(C++11) |
tuple accesses specified element (function template) |
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20) |
lexicographically compares the values in the tuple (function template) |
(C++11) |
specializes the std::swap algorithm (function template) |
[edit] Helper concepts
(C++23) |
specifies that a type implemented the tuple protocol (std::get, std::tuple_element, std::tuple_size) (exposition-only concept*) |
[edit] Helper classes
(C++11) |
obtains the size of
a |
|