On 2013-08-14 08:29, ilya-stromberg wrote:

Sorry, I think that example is WRONG!
Your example:

void main ()
{
     auto archive = new XmlArchive!();
     auto serializer = new Serializer;

     auto foo = new Foo;
     foo.a = 3;

     serializer.serialize(foo);
     auto foo2 = serializer.deserialize!(Foo)(archive.untypedData);

     writeln(foo2.a); // prints "3"
     assert(foo.a == foo2.a);
}

As I can see, it should be:

     auto archive = new XmlArchive!();
     auto serializer = new Serializer(archive);

Please fix example or correct me.

Right, good catch.

Note that current DDocs version supports to generate documentation from
unittests - it lets as make shure that documentation is correct. Shall
we add the condition of examples generation from unittests as required?

How do I do that?

--
/Jacob Carlborg

Reply via email to