ingletons, stream objects, and other classes must disable copying and assignment. However, C++ doesn't yet provide a direct mechanism for disabling copying. Another related problem exists with undesirable conversions of arguments passed to a function. The following sections will show how to work around these limitations to block undesirable copying and assignments and prevent implicit conversions of arguments.
There's no means to suppress the compiler's automatic declaration of a copy constructor and an assignment operator—even if you wish to disable copying and assignment of certain objects. Likewise, you cannot instruct the compiler to disable automatic conversions of arguments passed to a function.
Declare the copy constructor and assignment operator explicitly as private members without defining them. To prevent undesirable implicit conversions of arguments, declare dummy signatures that intercept the wrong types of arguments.