NullableRef.get

Gets the value. this must not be in the null state. This function is also called for the implicit conversion to T.

struct NullableRef(T)
@property ref inout @safe pure nothrow
inout(T)
get
()

Examples

import std.exception : assertThrown, assertNotThrown;

NullableRef!int nr;
//`get` is implicitly called. Will throw
//an error in non-release mode
assertThrown!Throwable(nr == 0);

nr.bind(new int(0));
assertNotThrown!Throwable(nr == 0);

Meta

Suggestion Box / Bug Report