Lecture overview -- Keyboard shortcut: 'u'  Previous page: Base class access -- Keyboard shortcut: 'p'  Next page: Base class access - Examples -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 4 - Page 22 : 24
Notes about C++
Abstraction Mechanisms, Part 2
Base class access - the C++ rules

To see this image you must download and install the SVG plugin from Adobe.In Firefox please consultthis page.

The class B is a specialization of class A

  • The C++ Programming Language: Page 406
 

  • A is a private base class of B:

    • Public and protected members in A becomes private in B

    • Protected members in A are restricted to be private in B

      • They would normally be visible in subclasses of B

    • The default case for classes

  • A is a protected base class of B:

    • Public members in A becomes protected in B

  • A is a public base class of B:

    • Public members in A will also be public in B

    • This is the 'normal case' - but not the default case for classes

Friends of B are on equal footing to members of B

Upcasting to a private or protected base A is restricted

See also the The C++ Programming Language formulations of the rules page 406