Range (computer programming)

Depending on the environment, a warning, a fatal exception, or unpredictable behavior will occur if the program attempts to access an array element that is outside the range.

Another meaning of range in computer science is an alternative to iterator.

When used in this sense, range is defined as "a pair of begin/end iterators packed together".

[1] It is argued [1] that "Ranges are a superior abstraction" (compared to iterators) for several reasons, including better safety.

Rust has a built-in range struct in the standard library in std::ops::Range.

A generic class representing a range, it contains a start property and a end property