Header Reference: <tuple>
Header Reference: <tuple>
The main tuple types, helpers, and tuple-like customization points provided by <tuple>.
Header Reference: <tuple>
The main tuple types, helpers, and tuple-like customization points provided by <tuple>.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
Header reference pages are meant to answer a practical question quickly: what this header provides, when to reach for it, and which usage rules are easiest to get wrong.
<tuple>std::tuple<Ts...>std::make_tuplestd::forward_as_tuplestd::tiestd::tuple_sizestd::tuple_elementstd::get<I>(...)std::get<T>(...)std::applystd::tuple_catstd::ignoreUse <tuple> when you need heterogeneous fixed-size grouping, structured decomposition support, or generic tuple-like handling.
std::applystruct instead of a tuple when element meaning matters to readers.std::pair covers the common two-value case, but tuples scale to arbitrary arity.#include <tuple>
int main() {
// Start with the primary facility from <tuple>.
// Then verify lifetime, invalidation, ordering, or error-handling rules.
return 0;
}