mir_rcarray

Thread safe reference counting array.

The implementation never adds roots into the GC.

Constructors

this
this(typeof(null) )
this
this(size_t length, bool initialize, bool deallocate)
this
this(typeof(this) rhs)
Undocumented in source.
this
this(typeof(this) rhs)
Undocumented in source.
this
this(typeof(this) rhs)
Undocumented in source.
this
this(typeof(this) rhs)
Undocumented in source.

Destructor

~this
~this()

Members

Aliases

ThisTemplate
alias ThisTemplate = .mir_rcarray
Undocumented in source.
V
alias V = Unqual!T
Undocumented in source.
V
alias V = T
Undocumented in source.
V
alias V = T
Undocumented in source.
_thisPtr
alias _thisPtr = _payload
Undocumented in source.
serdeKeysProxy
alias serdeKeysProxy = T

Functions

_reset
void _reset()
Undocumented in source. Be warned that the author may not have intended to support it.
asSlice
auto asSlice()
asSlice
auto asSlice()
asSlice
auto asSlice()
context
mir_rc_context context()
Undocumented in source. Be warned that the author may not have intended to support it.
length
size_t length()
moveToSlice
auto moveToSlice()
opAssign
ref opAssign(typeof(null) )
opAssign
ref opAssign(typeof(this) rhs)
opAssign
ref opAssign(ThisTemplate!Q rhs)
opCmp
int opCmp(ThisTemplate!Y rhs)
opDollar
size_t opDollar()
opEquals
bool opEquals(typeof(null) )
bool opEquals(ThisTemplate!Y rhs)
opIndex
ref opIndex(size_t i)
opIndex
inout(T)[] opIndex()
proxySwap
void proxySwap(typeof(this) rhs)
ptr
inout(T)* ptr()
toHash
size_t toHash()

Mixins

__anonymous
mixin CommonRCImpl

Variables

_payload
T* _payload;

Mixed In Members

From mixin CommonRCImpl

lightConst
ThisTemplate!(const T) lightConst()
lightImmutable
ThisTemplate!(immutable T) lightImmutable()
moveToConst
ThisTemplate!(const Unqual!T) moveToConst()
_counter
size_t _counter()
opCast
C opCast()
opCast
C opCast()

Examples

auto a = RCArray!double(10);
foreach(i, ref e; a)
    e = i;
auto b = a;
assert(b[$ - 1] == 9);
foreach(i, ref e; b)
    assert(e == i);
b[4] = 100;
assert(a[4] == 100);

import mir.ndslice.slice;

auto s = a.asSlice; // as RC random access range (ndslice)
static assert(is(typeof(s) == Slice!(RCI!double)));
static assert(is(typeof(s) == mir_slice!(mir_rci!double)));

auto r = a[]; // scope array
static assert(is(typeof(r) == double[]));

auto fs = r.sliced; // scope fast random access range (ndslice)
static assert(is(typeof(fs) == Slice!(double*)));

Meta