[xsd-users] C++11, value semantics, and polymorphism

Boris Kolpackov boris at codesynthesis.com
Mon Feb 18 03:20:10 EST 2013


Hi Joël,

Klaim - Joël Lamotte <mjklaim at gmail.com> writes:

> It made me think that the code generated by xsd could benefit from a
> copy-on-write implementation too.

Copy-on-write is a can of worms. It can be useful in certain controlled
situations that is, where you can have a well defined read/write interface
rather than "we return a reference but have no idea if the object will
be modified or not" (which is what we have in XSD). In general-purpose
code, however, it adds too many restrictions and/or complexity (see why
COW is effectively no longer an option for std::string in C++11).

So, no, I don't think COW is a good idea for XSD.

Boris



More information about the xsd-users mailing list