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.
Your list looks great from the point of view of avoiding errors, e.g. deleting the same area of memory more than once due to shared pointers from implicit copying of objects.

I hope this is also relevant; from the statement "be aware of the ways (accidental) copying can be prevented" you might take this to mean 'be aware of unintentional unnecessary copying'. This would mean circumstances which might affect performance. In a very simple example your coding conventions might mean you should prefer:

```
std::string text1( "some text" );

```

over:

```
std::string text1 = "some text";

```

The second case would result in a temporary string being created to hold "some text" before the assignment operator is invoked (a form of copying) to populate text1 with "some text". Obviously this is a trivial example and good practice would dictate that you should use the constructor initialisation (first example) where ever possible.