GlobalPtr.proxySwap

Swap this with rhs

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

Examples

{
    GlobalPtr!long a = new long(1);
    GlobalPtr!long b = new long(2);

    a.proxySwap(b);
    assert(*a == 2);
    assert(*b == 1);

    import std.algorithm : swap;
    swap(a, b);
    assert(*a == 1);
    assert(*b == 2);
}

Meta