TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  OOP#015Checked automatically with code checker

This rule is Obsolete
Synopsis:Friends of a class should be avoided
Language:C++
Severity Level:9
Category:Object Oriented Programming


Description:

It is unadvised to use friend classes or functions, because it makes the design of a class less clear. The class behavior is not only defined by the class implementation itself, but also by its friends. This makes it harder to maintain the class.

An exception to this rule are friend operator functions, which can only be implemented outside a class.