TITLE: public base class method to private derived = nonsense RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 13 Oct 95 [ The base class has a virtual function f, a derived class overrides it with a private function f. Calling 'f' via a pointer or reference to the base class can result in calling the derived 'f'. ] That is what is supposed to happen. The base class has function 'f' in its public interface, and when you call 'f' via the virtual mechanism, you get the version appropriate for the actual object type. It would clearly be wrong to get the base-class 'f' for a derived object, for example. Accessibility is a compile-time concept in C++, not a run-time check. The real question is why you would make the function private in the derived class. That breaks the IS-A relationship, and if you don't want an IS-A relationship, you should not use public inheritance. In fact, if you want to disable features of the base class, you should probably not use inheritance at all. Composition (HAS-A) would seem to be more appropriate. [ Think about this for a minute. Assume that you really could remove a method in a derived class (make it private). You allocate a base instance and it enters your system. Some function somewhere gets a base pointer to it and, thinking its a base object, invokes foo, the function you removed. What is supposed to happen? You have in effect lied to the clients of base. The derived instance would be no longer usabe throughout the system as a substitute for a base! -adc ]