Cpp Coding Standards/ENC/NoFriends

From Apache OpenOffice Wiki
< Cpp Coding Standards‎ | ENC
Revision as of 22:51, 7 January 2007 by Thorsten (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The state of a class must only be changed by member functions. Else the interrelations become unmanageable.

Exceptions: Some functions, especially stream operators or arithmetic operators may need to be defined as non-member functions for technical reasons, though they are indeed part of the class's interface. Those operators need to be friends then.

Personal tools