Tuple.this

Constructor taking a compatible Tuple. Two Tuples are compatible iff they are both of the same length, and, for each type T on the left-hand side, the corresponding type U on the right-hand side can implicitly convert to T.

  1. this(Types values)
  2. this(U[n] values)
  3. this(U another)
    struct Tuple
    this
    (
    U
    )
    if (
    areBuildCompatibleTuples!(typeof(this), U)
    )

Parameters

another U

A compatible Tuple to build from. Its type must be compatible with the target Tuple's type.

Examples

alias IntVec = Tuple!(int, int, int);
alias DubVec = Tuple!(double, double, double);

IntVec iv = tuple(1, 1, 1);

//Ok, int can implicitly convert to double
DubVec dv = iv;
//Error: double cannot implicitly convert to int
//IntVec iv2 = dv;

Meta

Suggestion Box / Bug Report