Compound.getValue

Gets the tag's value at the given index, if it exists and can be casted to T. Otherwise returns defaultValue.

class Compound
pure @safe
typeof(T.value)
getValue
(
T : Tag
)
(
string name
,
lazy typeof(T.value) defaultValue
)
if (
__traits(hasMember, T, "value")
)

Examples

auto compound = new Compound(new Named!String("test", "value"));
assert(compound.getValue!String("test", "") == "value");
assert(compound.getValue!Int("test", 0) == 0);
assert(compound.getValue!String("miss", "miss") == "miss");

Meta