The OpenD Programming Language

JSONValue.arrayNoRef

Value getter for JSONType.array. Unlike array, this retrieves the array by value and can be used in @safe code.

One possible caveat is that, if you append to the returned array, the new values aren't visible in the JSONValue:

JSONValue json;
json.array = [JSONValue("hello")];
json.arrayNoRef ~= JSONValue("world");
assert(json.array.length == 1);
struct JSONValue
@property inout pure @trusted
inout(JSONValue[])
arrayNoRef
()

Throws

JSONException for read access if type is not JSONType.array.

Meta