StairsIterator

StairsIterator is used by stairs.

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
ptrdiff_t 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
Slice!Iterator opIndex(ptrdiff_t index)
opOpAssign
void opOpAssign(ptrdiff_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
Slice!Iterator opUnary()
opUnary
void opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_iterator
Iterator _iterator;
_length
size_t _length;

Examples

// 0
// 1 2
// 3 4 5
// 6 7 8 9
// 10 11 12 13 14
auto it = StairsIterator!(IotaIterator!size_t, "+")(1, IotaIterator!size_t());
assert(*it == [0]);
assert(it[4] == [10, 11, 12, 13, 14]);
assert(*(it + 4) == [10, 11, 12, 13, 14]);
++it;
assert(*it == [1, 2]);
it += 3;
assert(*it == [10, 11, 12, 13, 14]);
assert(it[-3] == [1, 2]);
assert(*(it - 3) == [1, 2]);
assert(it + 1 > it);
assert(it + 1 - 1 == it);
assert(it - 3 - it == -3);
--it;
assert(*it == [6, 7, 8, 9]);
// [0, 1, 2, 3, 4],
//    [5, 6, 7, 8],
//     [9, 10, 11],
//        [12, 13],
//            [14]]);

auto it = StairsIterator!(IotaIterator!size_t, "-")(5, IotaIterator!size_t());
assert(*it == [0, 1, 2, 3, 4]);
assert(it[4] == [14]);
assert(*(it + 4) == [14]);
++it;
assert(*it == [5, 6, 7, 8]);
it += 3;
assert(*it == [14]);
assert(it[-3] == [5, 6, 7, 8]);
assert(*(it - 3) == [5, 6, 7, 8]);
assert(it + 1 > it);
assert(it + 1 - 1 == it);
assert(it - 3 - it == -3);
--it;
assert(*it == [12, 13]);

Meta