Question: In our company's coding standard, we have been told to "be aware of the ways (accidental) copying can be prevented".

I am not really sure what this means, but assume that they mean we should stop classes from being copied if this is not required.

What I can think of is as follows:

1. Make the copy constructor of a class private.
2. Make the assignment operator (operator=) of a class private.
3. Make the constructor of a class explicit (to stop classes from being created using incorrect variables).
4. For all classes that carry out memory allocation and where copying is required, make sure that the copy constructor and assignment operator carry out deep copying rather than shallow copying.

Am I on the right track? Is there anything I might have missed out?

Answer: 
If your coding standard states "be aware of the ways (accidental) copying can be prevented", I'm guessing they aren't just talking about preventing copies from within the classes itself, but about the performance implications of unnecessary / accidental copies when *using* the classes.  

One of the main causes of unnecessarily wasted performance in the code of people new to C++ is unnecessary copying, usually through temporaries. Compilers are getting better and better at deciding when temporaries are not necessary (see ["Want speed? Pass by Value"](http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/), thanks to Konrad's comment), but the best thing to do is to learn to be aware of the inner workings of copying and temporaries in C++ (among others). For me, reading [Efficient C++](http://books.google.be/books?id=IR-MQiktobMC&dq=effecient+c%2B%2B&printsec=frontcover&source=bn&hl=en&ei=U1aWSs3OAYPbjQf10cywDA&sa=X&oi=book_result&ct=result&resnum=4#v=onepage&q=&f=false) really got me started.
If you are using boost, then the easiest way to prevent a class from being copied is by deriving your class from [noncopyable](http://www.boost.org/doc/libs/1_39_0/libs/utility/utility.htm):

```
#include <boost/noncopyable.hpp>

class Foo : private boost::noncopyable
{
}

```

It makes your intention clearer than manually making the copy constructor and assigment operator private, and it has the same result.