The OpenD Programming Language

toRCPtr

@trusted
toRCPtr
(
F
)

Return Value

Type: RCPtr!F

shared pointer constructed from the slim shared pointer.

The function has zero computation cost.

Examples

import core.lifetime: move;
struct S
{
    double e;
}
struct C
{
    int i;
    S s;
}

auto a = createSlimRC!C(10, S(3));
auto s = a.move.toRCPtr.shareMember!"s";
assert(s._counter == 1);
assert(s.e == 3);

Meta