Json.opBinaryRight - multiple declarations
Function Json.opBinaryRight
Performs binary operations between JSON values.
Json opBinaryRight(string op)
(
bool other
) const;
Json opBinaryRight(string op)
(
long other
) const @trusted;
Json opBinaryRight(string op)
(
BigInt other
) const @trusted;
Json opBinaryRight(string op)
(
double other
) const;
Json opBinaryRight(string op)
(
string other
) const @trusted
if (op == "~");
Json opBinaryRight(string op)
(
Json[] other
) @trusted;
The two JSON values must be of the same run time type or a JSONException will be thrown. Only the operations listed are allowed for each of the types.
- Null
- none
- Bool
- &&, ||
- Int
- +, -, *, /, %
- Float
- +, -, *, /, %
- String
- ~
- Array
- ~
- Object
- in
Function Json.opBinaryRight
Checks wheter a particular key is set and returns a pointer to it.
For field that don't exist or have a type of Type
,
the in
operator will return null
.
Example
auto j = Json .emptyObject;
j["a"] = "foo";
j["b"] = Json .undefined;
assert("a" in j);
assert(("a" in j) .get!string == "foo");
assert("b" !in j);
assert("c" !in j);