Feasible Idea?: Range Tester

Philippe Sigaud philippe.sigaud at gmail.com
Thu Mar 21 12:24:40 PDT 2013


>> - Upon instantiating a new random access range, 'r.front == r[0]', and
>>   then after 'r.popFront()', 'r.front == r[1]', etc.
>
> This should be relatively easy to check.

Is that really the behaviour for RA ranges? I'd say that after calling
r.popFront(), then r.front == r[0].
The test could be:

assert(r has at least two elements);
auto nextOne = r[1];
r.popFront();
assert(r.front == nextOne);


More information about the Digitalmars-d mailing list