[xsd-users] Plans f or C++11?

Klaim - Joël Lamotte mjklaim at gmail.com
Mon Jun 4 22:22:14 EDT 2012


On Mon, Jun 4, 2012 at 11:50 PM, Ray Lischner <rlischner at proteuseng.com>wrote:

> That is, if an element has cardinality one, don't use a pointer to store
> it, and don't take an auto_ptr<> argument in the constructor. Instead, take
> an object by value, and move it into the data member. The root-element
> construction functions should return objects by value, so they can be moved
> to their destination. Etc., etc., etc.
>

I think a more obvious enhancement would be to replace the auto_ptr with
unique_ptr.
I believe It have different costs than when modifying model data than
relying on move semantic that would help only for elements containing other
elements, and not for most the values they hold.
Now, I agree that having the option to generate the code in a
movable/copyable only fashion (instead of pointers) would be interesting
too anyway.

Joel Lamotte


More information about the xsd-users mailing list