On 2011-08-22 00:35, Andrei Alexandrescu wrote:
On 8/21/11 1:19 PM, Jacob Carlborg wrote:
On 2011-08-21 17:30, Robert Clipsham wrote:
On 21/08/2011 16:05, Jacob Carlborg wrote:
This is for a serialization library where third party types need to be
serializable. I don't like the idea of annotate everything that should
be serializable.
You don't need to annotate it:
void serialize(T)(T something);
You have access to all the CT reflection stuff, and can generate the
necessary runtime reflection with that.
I already have a fully working serialization library. I'm hoping to make
it better. The problem is when (de)serializing through a base class
reference. Currently you need to register the subclass with the
serializer. If T is Base and the actually runtime type is Sub it won't
work.
If we get to the point where adding one line of code inside or
(preferably) outside a type to make it serializable, that would be great.
Andrei
That's already what I have and it's only necessary to register
subclasses that are serialized through base class references. If we get
runtime reflection as I suggested in my original post, that wouldn't be
needed. In addition to that I was hoping it would make it easier to
implement a binary archive.
Project page: http://www.dsource.org/projects/orange
Source code: https://github.com/jacob-carlborg/orange
--
/Jacob Carlborg