Re: subclassing question

Tech-Archive recommends: Fix windows errors by optimizing your registry



"robbio" wrote:
So, if your example is right, then by default
A::SomeFunction(...) is private to class A, and class B never
see the A::Some Function(...) as its method also.

This is not entirely true. You confuse a visibility of a method
with its access rights. Class B can see `A::SomeFunction' method
all right. What it cannot do is to access `A::SomeFunction' in
order to perfom a call (or to take an address of the method).

During call resolution function properties are tested in the
following order:

1. Name matching.
2. Argument overloading matching.
3. Access rights.

Every name in the base class (including private ones) is visible
in derived class.

Alex


.



Relevant Pages

  • Re: Newbie question on windows/java/tcl I/O
    ... >the heart of his reply verbatim: ... > stderr. ... If you need immediate and/or private help, ... Windows I/O channels certainly do confuse many of us ...
    (comp.lang.tcl)
  • Re: private member access
    ... > I know this is a very simple c++ question, but I thought that private ... > data members were only accessible inside the class. ... Because access rights are class-wide, ... John Carson ...
    (microsoft.public.vc.language)
  • Re: subclassing question
    ... with its access rights. ... What it cannot do is to access `A::SomeFunction' in order to perfom ... Argument overloading matching. ... derived class. ...
    (microsoft.public.vc.language)
  • Re: by default, public or private?
    ... A value delclared inside a method can only be private to that method. ... value on Class level can have other access rights. ... from Randy). ...
    (microsoft.public.dotnet.languages.vb)