View source code
Display the source code in std/json.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.

Function std.json.JSONValue.toHash

Calculate a numerical hash value for this value, allowing JSONValue to be used in associative arrays.

ulong toHash() pure nothrow @nogc @trusted const;

Example

assert(JSONValue(10).opEquals(JSONValue(10.0)));
assert(JSONValue(10) != (JSONValue(10.5)));

assert(JSONValue(1) != JSONValue(true));
assert(JSONValue.emptyArray != JSONValue.emptyObject);

assert(parseJSON(`{"a": 1, "b": 2}`).opEquals(parseJSON(`{"b": 2, "a": 1}`)));

Authors

Jeremie Pelletier, David Herberth

License

Boost License 1.0.