Property

Wraps std.variant.Variant

Constructors

this
this(T value)
Undocumented in source.

Alias This

value

Members

Aliases

Callable
alias Callable = Variant delegate()
Undocumented in source.

Functions

get
auto get()

Shadows std.variant.Variant.get.

get
auto get()

Shadows std.variant.Variant.get.

opAssign
void opAssign(T value)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

isCallableValue
bool isCallableValue;
Undocumented in source.
value
std.variant.Variant value;
Undocumented in source.

Examples

Property p;
assert(!p.isCallableValue);
p = 42;
assert(!p.isCallableValue);
assert(p == 42);
assert(p.get!int == 42);

p = () @system => Variant(1337);
assert(p.isCallableValue);
assert(p.get!int() == 1337);

auto prop1 = Properties("first");
prop1["foo"] = "hello";

auto prop2 = Properties("second");
prop2["foo"] = () @system => Variant(prop1["foo"].get!string ~ " world!");

assert(prop2["foo"].isCallableValue);
assert(prop2["foo"].get!string() == "hello world!");
prop1["foo"] = "goodbye cruel";
assert(prop2["foo"].get!string() == "goodbye cruel world!");

Meta