map and virtual operator< for base class

John Fine johnsfine@verizon.net
Mon May 10 23:36:00 GMT 2010


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
>



More information about the Gcc-help mailing list