> One quick question - is this covered in the proposal? > > class Base { > virtual int f( int ba, char bb ); > }; > > class Derived { > virtual int f( int da, char db ); // is this allowed and does it count > like a base class function override? > }; > > Derived d; > Base* b = &d; > > // What is the validity of the four cases below?
The proposal does not address this explicitly. I think the following behaviour falls out naturally: > b->f( ba=0, bb=‘c’ ); // valid > b->f( da=0, db=‘c’ ); // invalid (1) > d.f( ba=0, bb=‘c’ ); // invalid (2) > d.f( da=0, db=‘c’ ); // valid since (1) name lookup and overload resolution is based on the static type (since they happen at compile time), and (2) when the static type is the derived type, the derived name hides the base name. I think this behaviour is reasonable. I'm open to being convinced otherwise. Cheers, Botond _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform