### Access Declarations

You can restore access to members of a base class using an access declaration. It allows you to change the access of a public member of a private or protected base class back to public. You can also change the access of a protected member of a private base class back to protected. Access is adjusted by using the base class member qualified name in the public or protected declarations of the derived class.

You only use access declarations to restore base class access. You cannot change the access to a member to give it more access than it was originally declared with. You cannot change the access of a private member to public or to protected. You cannot change the access of a protected member to public.

An access declaration cannot be used to restrict access to a member that is accessible in a base class.

It is redundant to use an access declaration to change the access to a public member of a public base class to public , or to change the access to a protected member of a protected base class to protected.

Access declarations can only be used to adjust the access of a member of a base class. The base class that an access declaration appears in can be directly or indirectly inherited by the derived class.

You cannot adjust the access to a base class member if a member with the same name exists in a class derived from that base class.

If you use an access declaration to adjust the access to an overloaded function, the access is adjusted for all functions with that name in the base class.

Examples of Access Declarations

Access
Derivation Access of Base Classes
Access Resolution
Member Access
Derivation
Overloading Functions