var.opIndex

var opIndex(string key) ref @safe

Access a child value by key, turning this instance into a map on first use.

Semantics:

  • If this value is currently Type.NULL, it is converted to a map (Type.OBJECT).
  • If this value is not a map after that (i.e., it was a scalar or array), an assertion fails.
  • Returns a reference to the stored child var, inserting a default var.init if missing.

Returns

A reference to the value stored at key.
const(var) opIndex(string key) ref const @safe

Const overload of opIndex for read-only map access.

Unlike the mutable overload, this does not convert Type.NULL to a map, and does not insert missing keys. It asserts if the value is not a map or if the key is not present.

Returns

A const reference to the value stored at key.
var opIndex(size_t index) ref @safe
No documentation available for this declaration.
const(var) opIndex(size_t index) ref const @safe

Const overload of opIndex for read-only array access.

Returns

A const reference to the element at index.