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:
“It looks as if
Some pallid thing had squashed its features flat
And its eyes shut with overeagerness
To see what people found so interesting
In one another, and had gone to sleep
Of its own stupid lack of understanding,
Or broken its white neck of mushroom stuff
Short off, and died against the windowpane.”
—Robert Frost (18741963)
“It is a tribute to the peculiar horror of contemporary life that it makes the worst features of earlier timesthe stupefaction of the masses, the obsessed and driven lives of the bourgeoisieseem attractive by comparison.”
—Christopher Lasch (b. 1932)
“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)