Friend

Nasza ocena:

3
Wyświetleń: 679
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Friend - strona 1 Friend - strona 2

Fragment notatki:

Friend  by declaring a ”friendly” code we allow accessing protected and private members of the class class A { friend C::theMethodNoArg(); // specific method (if overloaded, then with specific args) friend class B; // concerns whole declaration of B // declarations inside B also can access // non-public A members friend fun(); // specific function (if overloaded, then with specific args) }  friendship is not inherited  friendship is not transitive  friendship is declared in any section of a class (even private) class M { friend void f() { … } }; is equivalent to: class M { friend void f(); }; void f() { … } ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz