libperun

Class std.rt.Tuple

Synopsis

public  class Tuple< A, B >

A pairing of objects.

The pairing is ordered (there is a first element and a second element), and they may be of different types. Two tuples compare equal if both of their elements are equal, and the hash for a tuple is a function of the hashes of its elements.

Due to this property, it is possible to define "recursive tuples" which contain more than two elements, by making the second element a tuple itself. For example, Tuple< A, Tuple<B, C> >, is a tuple (A, B, C). While the first element could be a tuple instead, it is a convention to recursively make the second element a tuple.

Fields

Constructors

public Tuple();

Construct a tuple with both elements null.

public Tuple(A a,B b);

Construct a tuple with the specified two elements.

Methods

public dword_t hash();

No description given

public bool opEquals(Object otherObj);

No description given

public A getLeft();

Return the left element.

Returns

The left element.

public B getRight();

Return the right element.

Returns

The right element.