Returns true if R is an input range. An input range must
define the primitives empty, popFront, and front. The
following code should compile for any input range.
Rr; // can define a range objectif (r.empty) {} // can test for emptyr.popFront(); // can invoke popFront()autoh = r.front; // can get the front of the range of non-void type
The following are rules of input ranges are assumed to hold true in all
Phobos code. These rules are not checkable at compile-time, so not conforming
to these rules when writing ranges or range based code will result in
undefined behavior.
r.empty returns false if and only if there is more data
available in the range.
r.empty evaluated multiple times, without calling
r.popFront, or otherwise mutating the range object or the
underlying data, yields the same result for every evaluation.
r.front returns the current element in the range.
It may return by value or by reference.
r.front can be legally evaluated if and only if evaluating
r.empty has, or would have, equaled false.
r.front evaluated multiple times, without calling
r.popFront, or otherwise mutating the range object or the
underlying data, yields the same result for every evaluation.
r.popFront advances to the next element in the range.
r.popFront can be called if and only if evaluating r.empty
has, or would have, equaled false.
Also, note that Phobos code assumes that the primitives r.front and
r.empty are O(1) time complexity wise or "cheap" in terms of
running time. O() statements in the documentation of range functions
are made with this assumption.
Returns true if R is an input range. An input range must define the primitives empty, popFront, and front. The following code should compile for any input range.
The following are rules of input ranges are assumed to hold true in all Phobos code. These rules are not checkable at compile-time, so not conforming to these rules when writing ranges or range based code will result in undefined behavior.
Also, note that Phobos code assumes that the primitives r.front and r.empty are O(1) time complexity wise or "cheap" in terms of running time. O() statements in the documentation of range functions are made with this assumption.