tuple-like, pair-like
Min standard notice:
- A type T models and satisfies the concept tuple-like if std::remove_cvref_t
is a specialization of std::array, std::complex, (since C++26) std::pair,std::tuple, orstd::ranges::subrange.
# Declarations
template< class T >
concept tuple-like = /* see below */;
(since C++23) (exposition only*)
template< class T >
concept pair-like =
tuple-like<T> && std::tuple_size_v<std::remove_cvref_t<T>> == 2;
(since C++23) (exposition only*)
# 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.