Function IntrusivePtr.load

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

UnqualSmartPtr!This load(MemoryOrder order = MemoryOrder.seq, This)() scope;

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);
}