关于友元函数的优缺点(on advantage and disadvantage of friends' function)
a summary of c++ friends' function
in fact, there are probable the following two situations needs to use the friends' function:
(1)some occasions of operator overloading needs to use friends' function
(2)two classed need to share data
the advantage and disadvantage of using friends' function
advantage: can improve efficiency, simple and clear expres
disadvantage:friends' function break the encapsulation mechanism

浙公网安备 33010602011771号