tuple-like, pair-like - cppreference.com (original) (raw)
| template< class T >concept tuple-like = /* see below */; | (1) | (since C++23) (exposition only*) |
|---|---|---|
| (2) | (since C++23) (exposition only*) |
_pair-like_objects are_tuple-like_objects with exactly 2 elements.
[edit] Notes
_tuple-like_ types implement the tuple protocol, i.e., such types can be used with std::get, std::tuple_element and std::tuple_size.
Elements of _tuple-like_ types can be bound with structured binding.
[edit] See also
_tuple-like_ and _pair-like_ are used in the following standard library components:
| (constructor) | constructs a new tuple (public member function) [edit] |
|---|---|
| operator= | assigns the contents of one tuple to another (public member function) [edit] |
| operator==operator!=operator<operator<=operator>operator>=operator<=>(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) [edit] |
| std::basic_common_reference<_tuple-like_>(C++23) | determines the common reference type of a tuple and a tuple-like type (class template specialization) [edit] |
| std::common_type<_tuple-like_>(C++23) | determines the common type of a tuple and a tuple-like type (class template specialization) [edit] |
| tuple_cat(C++11) | creates a tuple by concatenating any number of tuples (function template) [edit] |
| apply(C++17) | calls a function with a tuple of arguments (function template) [edit] |
| make_from_tuple(C++17) | construct an object with a tuple of arguments (function template) [edit] |
| (constructor) | constructs new pair (public member function of std::pair<T1,T2>) [edit] |
| operator= | assigns the contents (public member function of std::pair<T1,T2>) [edit] |
| operator PairLike | converts the subrange to a pair-like type (public member function of std::ranges::subrange<I,S,K>) [edit] |
| ranges::elements_viewviews::elements(C++20) | takes a view consisting of tuple-like values and a number N and produces a view of Nth element of each tuple(class template) (range adaptor object)[edit] |