The key concept to understand ranges in the general case is that, unless they are infinite, they are consumable. In idiomatic usage, they aren't intended to be kept around, adding and removing elements to and from them as if they were some sort of container. A range is generally created only when needed, passed to an algorithm as input, then ultimately consumed, often at the end of a chain of algorithms. Even forward ranges and output ranges with their
put primitives usually aren't intended to live beyond an algorithm.
That's not to say it's forbidden to keep a range around; some might even be designed for long life. For example, the random number generators in
std.random are all ranges that are intended to be reused. However, ...