UniqueTake

Members

Aliases

opDollar
alias opDollar = length
back
auto ref back()
auto back(ElementType!R v)

Range primitives

Functions

empty
bool empty()
front
auto ref front()
auto front(ElementType!R v)
length
size_t length()

Range primitives

maxLength
size_t maxLength()

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 maxLength is reached.

moveAt
auto moveAt(size_t index)
moveBack
auto moveBack()
opIndex
auto ref opIndex(size_t index)
opIndexAssign
void opIndexAssign(ElementType!R v, size_t index)
opSlice
auto opSlice(size_t i, size_t j)
popBack
void popBack()
popFront
void popFront()
save
UniqueTake save()

Range primitives

Variables

source
R source;

User accessible in read and write

Examples

array range

1 import nxt.dynamic_array : SA = DynamicArray;
2 import std.traits : isIterable;
3 import std.range.primitives : isInputRange;
4 alias C = SA!int;
5 
6 auto cs = C([11, 13].s).intoUniqueRange;
7 
8 alias CS = typeof(cs);
9 static assert(isInputRange!(typeof(cs)));
10 static assert(isIterable!(typeof(cs)));
11 
12 assert(cs.front == 11);
13 cs.popFront();
14 
15 assert(cs.front == 13);
16 cs.popFront();
17 
18 assert(cs.empty);

Meta