The OpenD Programming Language

mir_rci

Thread safe reference counting iterator.

Constructors

this
this(RCArray!T array)
this
this(T* _iterator, RCArray!T array)

Members

Functions

lightConst
mir_rci!(const T) lightConst()
lightImmutable
mir_rci!(immutable T) lightImmutable()
lightScope
inout(T)* lightScope()
opAssign
ref opAssign(typeof(null) )
opAssign
ref opAssign(typeof(this) rhs)
opAssign
ref opAssign(mir_rci!Q rhs)
opBinary
mir_rci!T opBinary(ptrdiff_t index)
opBinary
mir_rci!(const T) opBinary(ptrdiff_t index)
opBinary
mir_rci!(immutable T) opBinary(ptrdiff_t index)
opBinary
ptrdiff_t opBinary(typeof(this) right)
opCmp
int opCmp(typeof(this) right)
opEquals
bool opEquals(typeof(this) right)
opIndex
inout(T) opIndex(ptrdiff_t index)
opIndex
auto opIndex(Slice!(IotaIterator!size_t) slice)
opOpAssign
void opOpAssign(ptrdiff_t index)
opSlice
Slice!(IotaIterator!size_t) opSlice(size_t i, size_t j)
opUnary
inout(T) opUnary()
opUnary
void opUnary()

Variables

_array
RCArray!T _array;
_iterator
T* _iterator;

Examples

import mir.ndslice.traits: isIterator;
import mir.ndslice.slice;
import mir.rc.array;
auto slice = mir_rcarray!double(10).asSlice;
static assert(isIterator!(RCI!double));
static assert(is(typeof(slice) == Slice!(RCI!double)));
auto matrix = slice.sliced(2, 5);
static assert(is(typeof(matrix) == Slice!(RCI!double, 2)));
slice[7] = 44;
assert(matrix[1, 2] == 44);
import mir.ndslice.slice;
import mir.rc.array;

alias rcvec = Slice!(RCI!double);

RCI!double a, b;
a = b;

RCI!(const double) ca, cb;
ca = cb;
ca = cast(const) cb;

void foo(scope ref rcvec x, scope ref rcvec y)
{
    x[] = y[];
    x[1] = y[1];
    x[1 .. $] += y[1 .. $];
    x = x.save;
}

Meta