This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: map and virtual operator< for base class


I believe the second definition masks the first, rather than overriding the first, because the input is different:
const Base&
vs.
const Tst&


Bernd Prager wrote:

class Base { public: virtual bool operator<(const Base& b) const; ...};

...

class Tst: public Base {
public:
bool operator<(const Tst& t) const; // less then



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]