The TR1 technical report describes extensions to the C++ standard library.
Many of these extensions will be considered for the next
iteration of the C++ standard. TR1 describes a tuple type, and
support for treating `std::pair` as a type of tuple.
Fusion provides full support for the __tr1__tuple__ interface, and the extended
uses of `std::pair` described in the TR1 document.
[section Class template tuple]
Fusion's implementation of the __tr1__tuple__ is also a fusion __forward_sequence__.
As such the fusion tuple type provides a lot of functionality beyond that required by TR1.
Currently tuple is basically a synonym for __vector__, although this may be changed
in future releases of fusion.
[heading Synopsis]
template<
typename T1 = __unspecified__,
typename T2 = __unspecified__,
...
typename TN = __unspecified__>
class tuple;
/tuple.hpp>
[section Construction]
[heading Description]
The __tr1__tuple__ type provides a default constructor, a constructor that takes initializers for all of its elements, a copy constructor, and a converting copy constructor. The details of the various constructors are described in this section.
[heading Specification]
[variablelist Notation
[[`T1 ... TN`, `U1 ... UN`][Tuple element types]]
[[`P1 ... PN`] [Parameter types]]
[[`Ti`, `Ui`] [The type of the `i`th element of a tuple]]
[[`Pi`] [The type of the `i`th parameter]]
]
tuple();
[*Requirements]: Each `Ti` is default constructable.
[*Semantics]: Default initializes each element of the tuple.
tuple(P1,P2,...,PN);
[*Requirements]: Each `Pi` is `Ti` if `Ti` is a reference type, `const Ti&` otherwise.
[*Semantics]: Copy initializes each element with the corresponding parameter.
tuple(const tuple& t);
[*Requirements]: Each `Ti` should be copy constructable.
[*Semantics]: Copy constructs each element of `*this` with the corresponding element of `t`.
[*Requirements]: Each `Ti` shall be constructible from the corresponding `Ui`.
[*Semantics]: Constructs each element of `*this` with the corresponding element of `t`.
[endsect]
[section Tuple creation functions]
[heading Description]
TR1 describes 2 utility functions for creating __tr1__tuple__s. `make_tuple` builds a tuple out of it's argument list, and `tie` builds a tuple of references to it's arguments. The details of these creation functions are described in this section.
[*Returns]: tuple<T1&, T2&, ..., TN&>(t1, t2, ..., tN). When argument `ti` is `ignore`, assigning any value to the corresponding tuple element has no effect.