Daily bit(e) of C++ | tuple-like, pair-like
Daily bit(e) of C++ #460, The consolidating concepts of tuple-like and pair-like that types that include: std::pair, std::tuple, std::array, std::complex (C++26) and std::ranges::subrange.
C++23 formalized the concepts of tuple-like and pair-like types.
The set of tuple-like types is currently: std::array, std::pair, std::tuple, std::ranges::subrange and std::complex (since C++26).
Pair-like types are tuple-like types that have two elements.
All tuple-like types support a base set of operations:
assignment
comparisons
std::apply, std::make_from_tuple
std::tuple_size, std::tuple_element
std::tuple_cat