Re: [Dev-C++] operator+ and inheritance
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2004-05-09 11:07:11
|
OROSZI Bal=E1zs wrote:
> class Derived
> {
> public:
> Derived operator+( const Derived& d )
> {
> Derived sum;
>=20
> // assign "this + d" to sum:
> sum =3D Base::operator+( d );
I have realised, that the above line does not compile, so I came up with=20
another beauty:
sum.Base::operator=3D( Base::operator+( d ) );
The questions in my previous mail remain however.
--
Greetings,
Bal=E1zs
|