Which access specifiers will not affect a friend function?

None of the access specifies affect a friend.

When you declare a function/method or class as a friend you are making it part of the public interface to your class (thus implying a tight cupping).

A friend is actually able to see all the members of your class (you could think of it as a member function but without the implied this parameter). As such it is actually tightly coupled to your class. Any change in the internal representation of your class is going to be reflect in changes to the implementation of all public interface members.

Browse More Popular Posts

Leave a Comment