Features
- Friendships are not corresponded – If class
Ais a friend of classB, classBis not automatically a friend of classA. - Friendships are not transitive – If class
Ais a friend of classB, and classBis a friend of classC, classAis not automatically a friend of classC. - Friendships are not inherited – A friend of class
Baseis not automatically a friend of classDerivedand vice versa; equally ifBaseis a friend of another class,Derivedis not automatically a friend and vice versa. - Access due to friendship is inherited – A friend of
Derivedcan access the restricted members ofDerivedthat were inherited fromBase. Note though that a friend ofDerivedonly has access to members inherited fromBaseto which Derived has access itself, e.g. ifDerivedinherits publicly fromBase,Derivedonly has access to the protected (and public) members inherited fromBase, not the private members, so neither does a friend.
Read more about this topic: Friend Class
Famous quotes containing the word features:
“The features of our face are hardly more than gestures which force of habit made permanent. Nature, like the destruction of Pompeii, like the metamorphosis of a nymph into a tree, has arrested us in an accustomed movement.”
—Marcel Proust (18711922)
“Art is the child of Nature; yes,
Her darling child, in whom we trace
The features of the mothers face,
Her aspect and her attitude.”
—Henry Wadsworth Longfellow (18071882)
Related Subjects
Related Phrases
Related Words