std.serialization: pre-voting review / discussion

ilya-stromberg ilya-stromberg-2009 at yandex.ru
Sat Aug 24 12:26:19 PDT 2013


On Saturday, 24 August 2013 at 17:47:35 UTC, Jacob Carlborg wrote:
> I actually noticed this problem when I wrote the example. 
> First, the interface Serializable is actually not necessary 
> because this is actually checked with at template at compile 
> time, it's possible to use these methods for structs as well. 
> Second, instead of checking for both "toData" and "fromData" 
> when serializing and deserializing it should only check for 
> "toData" when serializing and only for "fromData" when 
> deserializing.

In that case maybe we should remove "Serializable" interface? And 
just spesify that user must implement "toData" or "fromData" for 
custom serializing or deserializing. Is it possible?


More information about the Digitalmars-d mailing list