JSONValue.opBinaryRight

Provides support for the in operator.

Tests whether a key can be found in an object.

struct JSONValue
inout @safe
inout(JSONValue)*
opBinaryRight
(
string op : "in"
)
(
string k
)

Return Value

Type: inout(JSONValue)*

When found, the inout(JSONValue)* that matches to the key, otherwise null.

Throws

JSONException if the right hand side argument JSONType is not object.

Examples

JSONValue j = [ "language": "D", "author": "walter" ];
string a = ("author" in j).str;
*("author" in j) = "Walter";
assert(j["author"].str == "Walter");

Meta