Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Tuple creation functions

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.

Specification
template<typename T1, typename T2, ..., typename TN>
tuple<V1, V2, ..., VN> make_tuple(const T1& t1, const T2& t2, ..., const TN& tn);

Where Vi is X& if the cv-unqualified type Ti is reference_wrapper<X>, otherwise Vi is Ti.

Returns: tuple<V1, V2, ..., VN>(t1, t2, ..., tN)

template<typename T1, typename T2, ..., typename TN>
tuple<T1&, T2&, ..., TN&> tie(T1& t1, T2& t2, ..., TN& tn);

Returns: tuple<T1&, T2&, ..., TN&>(t1, t2, ..., tN). When argument ti is ignore, assigning any value to the corresponding tuple element has has no effect.


PrevUpHomeNext