------- Comment #8 from  2009-01-20 12:25 -------
(In reply to comment #7)
> In fact, private implies final (non-virtual), and does not put the function in
> the vtable (meaning it cannot override a base function).  From the spec: "All
> non-static non-private non-template member functions are virtual."

The sentence you've quoted states nothing about functions that _are_ private.

Moreover, a final method _can_ override a method in a base class.  Even so, an
interface has its own vtable, so the virtuality or not of a function with
respect to its class (or a class from which it is derived) should have nothing
to do with whether it can implement an interface method.

> If someone casts your class to an interface, do you want them to 
> now be able to call your private function?

Probably not.  But the way it's attempted in issue 2538 brings us back to the
problem of inheritance protection.  But we can talk about this there.


Reply via email to