Compound.opIndexAssign

Sets the value at the given index. If the tag's name is different from the given index, the tag's name will be changed to the given index's one.

  1. void opIndexAssign(T value, string name)
    class Compound
    pure nothrow @safe
    void
    opIndexAssign
    (
    T
    )
    (,
    string name
    )
    if (
    is(T : Tag) ||
    isNumeric!T
    ||
    is(T == bool)
    ||
    is(T == string)
    ||
    is(T == ubyte[])
    ||
    is(T == byte[])
    ||
    is(T == int[])
    )
  2. void opIndexAssign(Tag tag)

Examples

compound["string"] = new String("test", "test");
assert(compound["string"].name == "string");
compound["int"] = 12;
compound["string"] = "Another string";

Meta