1. The meaning of some classes determines that they do not have certain functions, that is, some functions can not be created to prevent the wrong use (for example, define a book class, it contains a variable that represents the ISBN, in which case the copy constructor and the assignment operator is obviously meaningless, Because the ISBN for any two books is different), the compiler produces these functions in cases where the creator of the class does not declare a default constructor, copy constructors, assignment operators, and destructors, in order to avoid this situation, These functions can be declared private and do not provide their definitions to prevent their use, but if these functions are called through other member functions or friend functions, the error will be found in the link period (the definition and use of the class are usually in different files).
2. In order to advance the link-period error to the compile time, you can set up a base class that contains only the declarations of these functions and set it to private, and then inherit it with the target class. The downside is that the inefficiency of inheritance and the emergence of multiple inheritance can prevent the "empty base class Optimization ".
Effective C + + clause 6 If you do not want to use a function generated automatically by the compiler, you should explicitly deny