std::Range class

Instances of the Range class represent ascending sequences of integer values. A range is defined by two objects, the start (lower bound) and the stop (upper bound). The range includes integers from start up to, but not including, the stop.

class Range
The Range type. Range objects can be constructed using the to operator.

Member constants

start
The lower bound of the range (included in the range).
stop
The upper bound of the range (not included in the range).

Methods

iterator()
Return an iterator object that returns all integer values between the lower bound and the upper bound, in ascending order and not including the upper bound.

Operations

x to y
Construct a range object representing a range x, x + 1, ..., y - 1. Both x and y must be integers.
for x in range
A range can be enumerated in ascending order with a for loop, starting with the lower bound and ending with one less than the upper bound.
range == x
Range objects can be compared for equality. Two range objects are equal if and only if both their lower and upper bounds are equal.
x in range
Return a boolean indicating whether x >= start and x < stop.
Str(range)
Return a string representation a range.
Hash(range)
Return the hash value of a range.