UCE Docs / DValue::operator[]

Signature

DValue& DValue::operator[](String s)

Parameters

s : child key to return or create
return value : reference to the child node

Returns a mutable reference to a child, creating the child when it does not already exist. If this value is an internal reference, the operation is forwarded to the target. This has the same creation behavior as get_or_create(), so use has(), key(), or get_by_path() for non-mutating reads.

Example

DValue m;
m["a"]["b"] = "nested";
print(m["a"]["b"].to_string(), "\n");
Output
nested