R
Robert Fendt
Hi all,
is this legal:
class interf1
{
virtual ~interf1() {}
virtual interf1* clone() = 0;
};
class interf2
{
vitual ~interf2() {}
virtual interf2* clone() = 0;
};
class impl : public interf1, public interf2
{
impl* clone();
};
It seems to work at least in GCC 'pedantic ANSI' mode, and I
think I recall something about covariant return types being
explicitely allowed in standard C++. Cannot check with VC++
right now...
However, assuming that it is legal and well-defined: are there
any hidden snares I should be aware of?
Regards,
Robert
is this legal:
class interf1
{
virtual ~interf1() {}
virtual interf1* clone() = 0;
};
class interf2
{
vitual ~interf2() {}
virtual interf2* clone() = 0;
};
class impl : public interf1, public interf2
{
impl* clone();
};
It seems to work at least in GCC 'pedantic ANSI' mode, and I
think I recall something about covariant return types being
explicitely allowed in standard C++. Cannot check with VC++
right now...
However, assuming that it is legal and well-defined: are there
any hidden snares I should be aware of?
Regards,
Robert