The OpenD Programming Language

serializeValue

Enumeration-value associative array serialization

Examples

import mir.ser.json: serializeJson;
enum E { a, b }
uint[E] ar = [E.a : 1];
auto car = cast(const)ar;
assert(serializeJson(car) == `{"a":1}`);
ar.remove(E.a);
assert(serializeJson(ar) == `{}`);
assert(serializeJson((uint[string]).init) == `{}`);

Meta