[xsd-users] Plans f or C++11?
Boris Kolpackov
boris at codesynthesis.com
Tue Jun 5 04:13:16 EDT 2012
Hi Ray,
Ray Lischner <rlischner at proteuseng.com> writes:
> What are your plans for C++11?
We are thinking about it ;-).
> Currently, Code Synthesis 3.3 has a number of features that can be
> used to reduce the amount of copying, such as using auto_ptr<> for
> required, non-fundamental data members, which would probably be
> better off taking advantage of move semantics.
>
> 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.
This is a good idea except for polymorphic objects. So we will have
to have separate mapping for polymorphic/non-polymorphic types. This
is the extra complexity that we could really do without.
> The root-element construction functions should return objects by
> value, so they can be moved to their destination.
The same story. We cannot do this for polymorphic objects.
> I realize this is a significant change to the way Code Synthesis
> works now, and you would need to support C++03 and C++11 in the
> same product, but I think the performance gains could be significant.
Yes, though we will need to think more about the implications,
especially wrt extra complexity and whether it is worth it. But
I agree, for starters, we should at least support the move
semantics for generated types plus use std::unique_ptr instead
of auto_ptr.
If you (or anyone else) have other suggestions/ideas wrt to C++11
support, do let me know.
Boris
More information about the xsd-users
mailing list