std::Pair class
Instances of the Pair class represent immutable pairs of two arbitrary values. Pairs can only be constructed using the colon (:) operator. A typical use of pair objects is as arguments to the constructor of the std::Map class, where pairs represent (key, value) pairs, and in range indexing.
- class Pair
- The Pair type. Pair objects can be constructed using the colon (:) operator. Within an index expression (inside square brackets [ ]), the left or right operand, or both, can be left out; in this case the values default to nil.
Member constants
Operations
- x : y
- Construct the pair (x, y).
- pair == x
- Pair objects can be compared for equality. Two pairs are equal if and only if both their left and right items are equal.
- Str(pair)
- Convert a pair to a string.
- Hash(pair)
- Return the hash value of a pair.