Class uncopyable{
Protected
Uncopyable () {}; Allow derived object construction and destruction
~uncopyable () {};
Private
Uncopyable (const uncopyalbe&); But stop copying.
uncopyable& operator= (const uncopyalbe&);
};
Class Homeforsale:private uncopyable{//class no longer declares
....//copy constructor or
}; Copy assignment operator
Generally either the client, member function, friend function tries to invoke the Copy Homeforsale object. This kind of writing will be categorically rejected.
Note:
In order to dismiss the function that the compiler automatically (secretly) provides, the corresponding member function can be declared private and not implemented, and the base class using Uncopyable is the same.
Clause 6: If you don't want to use the compiler auto-generated function, it is expressly denied (explicity disallow the using of compiler-generated functions you does not want)