To tylko jedna z 2 stron tej notatki. Zaloguj się aby zobaczyć ten dokument.
Zobacz
całą notatkę
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)