6.If you do not want to use a function generated by the compiler by default, you should explicitly deny
1. Sometimes you do not want the object to be copied and assigned, then the copy constructor and the assignment operator are placed in thePrivate:, but do these two functions need to be implemented? Assuming the implementation, then your class member methods andfriendfunctions (classes) can still use these methods, the best way is toPrivate:do not define them, so that when the member method orfriend:When a function (class) attempts to invoke these methods, a link error is reported because the method is not implemented. (This is how to prevent copying in iostream )
2. Available in multiple inheritanceprotected:Control
Summarize:
EC notes, Part Two: 6. If you do not want to use a function generated by the compiler by default, you should explicitly deny