RcPtr.proxySwap

Swap this with rhs

struct RcPtr
scope @trusted pure nothrow @nogc
void
proxySwap
(
ref scope typeof(this) rhs
)

Examples

{
    RcPtr!long a = RcPtr!long.make(1);
    RcPtr!long b = RcPtr!long.make(2);
    a.proxySwap(b);
    assert(*a == 2);
    assert(*b == 1);
    import std.algorithm : swap;
    swap(a, b);
    assert(*a == 1);
    assert(*b == 2);
    assert(a.useCount == 1);
    assert(b.useCount == 1);
}

Meta