IntrusivePtr.load

Returns the non shared IntrusivePtr pointer pointed-to by shared this.

struct IntrusivePtr
scope
load
(
MemoryOrder order = MemoryOrder.seq
this This
)
()

Examples

static struct Foo{
    ControlBlock!(int, int) c;
    int i;

    this(int i)pure nothrow @safe @nogc{
        this.i = i;
    }
}

shared IntrusivePtr!(shared Foo) x = IntrusivePtr!(shared Foo).make(123);

{
    IntrusivePtr!(shared Foo) y = x.load();
    assert(y.useCount == 2);

    assert(y.get.i == 123);
}

Meta