Alias SharedPtr.opUnary

Operator *, same as method 'get'.

struct SharedPtr
{
  // ...
  alias opUnary(string op : "*") = get;
  // ...
}

Examples

SharedPtr!long x = SharedPtr!long.make(123);
assert(*x == 123);
(*x = 321);
assert(*x == 321);
const y = x;
assert(*y == 321);
assert(*x == 321);
static assert(is(typeof(*y) == const long));