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

Click here to view the latest version of this page.



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.



T1 ... TN, U1 ... UN

Tuple element types

P1 ... PN

Parameter types

Ti, Ui

The type of the ith element of a tuple


The type of the ith parameter


Requirements: Each Ti is default constructable.

Semantics: Default initializes each element of the tuple.


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.

template<typename U1, typename U2, ..., typename UN>
tuple(const tuple<U1, U2, ..., UN>& t);

Requirements: Each Ti shall be constructible from the corresponding Ui.

Semantics: Constructs each element of *this with the corresponding element of t.