On Wednesday, 16 July 2014 at 00:38:46 UTC, Puming wrote:
3. define all classes and use template magic to generate companion builders just like protobuffer does. But that would be complicated and I don't know how to do it. Do you have any suggestion for this approach?

This would probably be a good solution, but it will be a bit tricky to generate the builder classes. Certainly doable. Take a look at std.traits: FieldTypeTuple and RepresentationTypeTuple, and the built in __traits(allMembers, <symbol>).

Reply via email to