Does “friend” violate encapsulation?

encapsulation friend violate
0
Posted

Does “friend” violate encapsulation?

0

No. It does not. “Friend” is an explicit mechanism for granting access, just like membership. You cannot (in a standard conforming program) grant yourself access to a class without modifying its source.

Related Questions