deserializeValue

Deserialize static array

Examples

assert(deserialize!(int[4])(serializeToJson(null)) == [0, 0, 0, 0]);
assert(deserialize!(int[4])(serializeToFghj(null)) == [0, 0, 0, 0]);
assert(deserialize!(int[4])(serializeToJson([1, 3, 4])) == [1, 3, 4, 0]);
assert(deserialize!(int[4])(serializeToFghj([1, 3, 4])) == [1, 3, 4, 0]);
assert(deserialize!(int[2])(serializeToJson([1, 3, 4])) == [1, 3]);
assert(deserialize!(int[2])(serializeToFghj([1, 3, 4])) == [1, 3]);

assert(deserialize!(char[2])(serializeToFghj(['a','b'])) == ['a','b']);
assert(deserialize!(char[2])(serializeToFghj(['a','\0'])) == ['a','\0']);
assert(deserialize!(char[2])(serializeToFghj(['a','\255'])) == ['a','\255']);
assert(deserialize!(char[2])(serializeToFghj(['\255'])) == ['\255','\0']);
assert(deserialize!(char[2])(serializeToFghj(['\255', '\255', '\255'])) == ['\255','\255']);

AA with value of aggregate type

struct Foo
{

}

assert (deserialize!(Foo[int])(serializeToJson([1: Foo()])) == [1:Foo()]);

Meta