This is a best-effort implementation of length for any kind of
range.
If hasLength!Range, simply returns range.length without
checking upTo (when specified).
Otherwise, walks the range through its length and returns the number
of elements seen. Performes O(n) evaluations of range.empty
and range.popFront(), where n is the effective length of range.
This is a best-effort implementation of length for any kind of range. If hasLength!Range, simply returns range.length without checking upTo (when specified). Otherwise, walks the range through its length and returns the number of elements seen. Performes O(n) evaluations of range.empty and range.popFront(), where n is the effective length of range.