input range serialization
import mir.algorithm.iteration : filter; static struct Foo { int i; } auto ar = [Foo(1), Foo(3), Foo(4), Foo(17)]; auto filtered1 = ar.filter!"a.i & 1"; auto filtered2 = ar.filter!"!(a.i & 1)"; import mir.ser.json: serializeJson; assert(serializeJson(filtered1) == `[{"i":1},{"i":3},{"i":17}]`); assert(serializeJson(filtered2) == `[{"i":4}]`);
import mir.ser.json: serializeJson; uint[2] ar = [1, 2]; assert(serializeJson(ar) == `[1,2]`); assert(serializeJson(ar[]) == `[1,2]`); assert(serializeJson(ar[0 .. 0]) == `[]`); assert(serializeJson((uint[]).init) == `[]`);