TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BALOG PAL
from: JONATHAN DE BOYNE POLLARD
date: 1997-10-21 00:22:00
subject: class member lookup

 BP> struct base {
 BP>     int f();
 BP>     int f(int,int);
 BP> } ;
 BP> struct derived : public base {
 BP>     int f();
 BP> };
 BP> derived a ;
 BP> a.f(1,2) ;                // ERROR
 BP> [Redefining] f() and inheriting parent's f(int,int) without 
 BP> additional problems would be [more] intuitive, and make no more 
 BP> work to the compiler.
Yes it would.  It would complicate name lookup enormously, since it would 
have to perform overload resolution across multiple scopes simultaneously.  
As the current language rules stand, name lookup occurs first, finding the 
`f' in the scope of class derived, and *then* overload resolution occurs, in 
the scope of the name that is found.
 ¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.