Range primitives
Range primitives
Access to maximal length of the range. Note: the actual length of the range depends on the underlying range. If it has fewer elements, it will stop before lengthMax is reached.
User accessible in read and write
array range
import std.experimental.allocator.mallocator : Mallocator; import nxt.container.dynamic_array : DA = DynamicArray; import std.traits : isIterable; import std.range.primitives : isInputRange; alias C = DA!(int, Mallocator); auto cs = C([11, 13].s).intoUniqueRange; alias CS = typeof(cs); static assert(isInputRange!(typeof(cs))); static assert(isIterable!(typeof(cs))); assert(cs.front == 11); cs.popFront(); assert(cs.front == 13); cs.popFront(); assert(cs.empty);