Re: [xsd-users] no abstract base classes with "Customizing the generated type — the complex case"
Oliver Schneider
xsd-users at oli-obk.de
Mon Aug 4 04:41:44 EDT 2014
Hi Boris,
> I gave it some thought and I don't think there is any use in having the
> _clone() function generated in *_base classes at all.
yes, i agree
> We cannot make it
> pure virtual (that would prevent using *_base as a member). But we can
> simply not generate it at all and I can't think of a good reason why the
> user-supplied implementation would ever want to call _clone() on *_base.
that would make the _clone function very dangerous. As it would give you
a bad copy.
I suggest leaving it in for using *_base as a member, and making it pure
virtual when polymorphism is requested for the class. In the case of
polymorphism, your are expecting that superman_impl is (implicitly)
castable to person_impl. (at least that's how i understood the
"person()" member function of the catalog class, i didn't test it).
/oliver
More information about the xsd-users
mailing list