Difference between revisions of "Cpp Coding Standards/ENC/NoFriends"
From Apache OpenOffice Wiki
< Cpp Coding Standards | ENC
m (Cpp Coding Standards/Encapsulation/NoFriends moved to Cpp Coding Standards/ENC/NoFriends: consistency) |
B michaelsen (Talk | contribs) |
||
Line 2: | Line 2: | ||
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. | 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. | ||
+ | [[Category:Coding Standards]] |
Latest revision as of 17:09, 14 December 2009
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.