Construction

| Home | Libraries | People | FAQ | More

#### Construction

###### 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.

###### Specification

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`.

    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`.