std::tuple

From Cppreference

Jump to: navigation, search
template< class... Types >
class tuple;
(C++11 feature)

Class template std::tuple is a heterogeneous fixed-size collection of values. It is a generalization of std::pair.

[edit] Member functions

(constructor)
constructs new tuple
(public member function)
operator=
assigns the contents
(public member function)
swap
swaps the contents
(public member function)

[edit] Non-member functions

make_tuple
creates a tuple object of the type defined by the argument types
(function template)
tie
creates a tuple of lvalue references or unpacks a tuple into individual objects
(function template)
forward_as_tuple
creates a tuple of rvalue references
(function template)
tuple_cat
creates a tuple by concatenating any number of tuples
(function template)
get
accesses specified element
(function template)
operator==
operator!=
operator<
operator<=
operator>
operator>=
lexicographically compares the values in the tuple
(function template)
std::swap(std::tuple) (C++11)
specializes the std::swap() algorithm
(function template)

[edit] Helper classes

tuple_size
obtains the size of tuple at compile time
(class template specialization)
tuple_element
obtains the type of the specified element
(class template specialization)
std::uses_allocator<std::tuple> (C++11)
specializes the std::uses_allocator type trait
(class template specialization)
ignore
placeholder to skip an element when unpacking a tuple using tie
(constant)