On Saturday, 25 April 2015 at 09:56:25 UTC, tired_eyes wrote:
I think this is ugly and clunky approach, what is the beautiful one?
What you clearly need is a serializer: look at these: http://wiki.dlang.org/Libraries_and_Frameworks#Serialization and also: https://github.com/search?utf8=✓&q=serializer+language%3AD&type=Repositories&ref=searchresultssome of them might have an API to save load an object or a struct in a single call.