{
GlobalPtr!long px1 = new long(1);
GlobalPtr!long px2 = new long(2);
px1 = px2;
assert(*px1 == 2);
}
{
GlobalPtr!long px = new long(1);
GlobalPtr!(const long) pcx = new long(2);
pcx = px;
assert(*pcx == 1);
}
{
const GlobalPtr!long cpx = new long(1);
GlobalPtr!(const long) pcx = new long(2);
pcx = cpx;
assert(*pcx == 1);
}
{
GlobalPtr!(immutable long) pix = new immutable(long)(123);
GlobalPtr!(const long) pcx = new long(2);
pcx = pix;
assert(*pcx == 123);
}
Shares ownership of the object managed by rhs.
If rhs manages no object, this manages no object too. If rhs is rvalue then move-assigns a RcPtr from rhs