toRCPtr

@trusted
RCPtr!F
toRCPtr
(
F
)
(
return SlimRCPtr!F contextAndValue
)

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