[xsde-users] covariance issue

Boris Kolpackov boris at codesynthesis.com
Thu Jun 18 12:17:34 EDT 2009


Hi Swati,

swati gaur <swati_gaur at yahoo.com> writes:

> Hi, I ve  compiled and could run files created using CodeSynthesis XSD/e 
> in VC++ 6.0 without any covariance issue. 
> What is covariance issue ??I don't know about it.

The covariant return type feature in C++ allows you to override
a virtual function with a return type that is derived from the
return type of this function as declared in the base class. Here
is an example:

struct RB {};
struct RD: RB {};

struct B
{
  virtual RB* f ();
};

struct D: B
{
  virtual RD* f ();
};

This feature is not supported in VC++ 6.0. The XSD/e runtime and
generated code only use covariant return types when support for
polymorphism is enabled. Amrita was accidently compiling files
from the XSD/e runtime which are only used when polymorphism is
enabled. Now, after this has been resolved, everything is working
fine.

Boris



More information about the xsde-users mailing list