SPtr.opUnary

Provides dereferencing for pointers that are not class

struct SPtr(T, Allocator = Mallocator)
static if(!is(T == class))
opUnary
(
string s
)
()
if (
s == "*"
)

Examples

class A {}
auto sptr = newShared!int(42);
assert(*sptr == 42);
const auto classPtr = newShared!A();
assert(!__traits(compiles, *classPtr));

Meta