When does the compiler provide definitions for the special members of a class?
问题 I know that when I define an empty class and provide no declarations at all, the compiler will provide definitions for the default and copy constructor, destructor and copy assignment operator. What are the rules for that? When does the compiler not provide a, say, copy constructor? What about the move constructor and move assignment operator? (Example: The compiler will not provide definitions for any assignment operator if my class has a reference member like int& . When else will something