Function SharedPtr.proxySwap
Swap this
with rhs
void proxySwap
(
scope ref typeof(this) rhs
) pure nothrow @nogc scope @trusted;
Examples
{
SharedPtr!long a = SharedPtr!long .make(1);
SharedPtr!long b = SharedPtr!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);
}