IotaIterator

Step counter.

IotaIterator is used by iota.

Members

Functions

lightConst
auto lightConst()
lightImmutable
auto lightImmutable()
opBinary
ptrdiff_t opBinary(typeof(this) right)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
auto opBinary(ptrdiff_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
auto opCmp(typeof(this) right)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(this) right)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
I opIndex(ptrdiff_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(ptrdiff_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
I opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
void opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_index
I _index;

Examples

IotaIterator!int iota;
assert(*iota == 0);

// iteration
++iota;
assert(*iota == 1);

assert(iota[2] == 3);
assert(iota[-1] == 0);

--iota;
assert(*iota == 0);

// opBinary
assert(*(iota + 2) == 2);
assert(*(iota - 3) == -3);
assert((iota - 3) - iota == -3);

// construction
assert(*IotaIterator!int(3) == 3);
assert(iota - 1 < iota);
int[32] data;
auto iota = IotaIterator!(int*)(data.ptr);
assert(*iota == data.ptr);

// iteration
++iota;
assert(*iota == 1 + data.ptr);

assert(iota[2] == 3 + data.ptr);
assert(iota[-1] == 0 + data.ptr);

--iota;
assert(*iota == 0 + data.ptr);

// opBinary
assert(*(iota + 2) == 2 + data.ptr);
assert(*(iota - 3) == -3 + data.ptr);
assert((iota - 3) - iota == -3);

// construction
assert(*IotaIterator!(int*)(data.ptr) == data.ptr);
assert(iota - 1 < iota);

Meta