Request for review - std.serialization (orange)

Kagamin spam at here.lot
Sun Mar 31 03:40:52 PDT 2013


On Monday, 25 March 2013 at 08:53:32 UTC, Jacob Carlborg wrote:
> With templates:
>
> class Serializer (T)
> class XmlArchive
>
> auto archive = new XmlArchive;
> auto serializer = new Serializer!(XmlArchive)(archive);
>
> struct Foo
> {
>     void toData (Serializer!(XmlArchive) serializer, 
> Serializer.Data key);
> }
>
> Foo is now locked to the XmlArchive. Or:
>
> class Bar
> {
>     void toData (T) (Serializer!(T) serializer, Serializer.Data 
> key);
> }
>
> toData cannot be virtual.

http://dpaste.dzfl.pl/0f7d8219


More information about the Digitalmars-d mailing list