[comp.lang.c] virtual operators

Michael_Hoennig@hh.maus.de (Michael Hoennig) (06/05/91)

Hi Bernhard,

BD>        virtual int operator< (Base &) const;   // less than operator for
Ba
BD>        virtual int operator< (const TestInt &) const;  // overide Base

this aren't the same methods because the parameter listes differ.
If calls refer to a Base* (as in your example), always the method
"virtual int opertor< (Base&) const" will be called, never the other
one, because its paramters doesn't match.
You see?

Adios

--
Michael Hoennig -- Dobbelersweg 45 -- D-2000 Hamburg 26 -- ++49 40 219 24 58
office: mi1@starlab.UUCP -- ++49 40 23 08 56 (StarDivision Hamburg)