Create an empty json object with std.json

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 22 04:54:38 PST 2016


On Friday, 22 January 2016 at 12:05:48 UTC, userABCabc123 wrote:
> when you add the first key, the value will be set to 
> JSON_TYPE.OBJECT
>
> ----
> import std.json;
>
> void main(string[] args)
> {
>     JSONValue json;
>     json["first"] = 0;
>     assert(json.type == JSON_TYPE.OBJECT);
> }
> ----

That's right, but I need an empty object, without any key set!



More information about the Digitalmars-d-learn mailing list