| Use Standard C++ Library headers defined by the language standard and not outdated .h headers. For example, use <iostream> and not <iostream.h>, <cstdio> and not <stdio.h>. |
| Use Standard Template Library containers and algorithms in preference to custom designs. |
| Make copying efficient for objects in containers. |
| Where copying is expensive use containers of pointers or smart pointers. |
| Do not attempt to insert derived class objects in a container that holds base class objects. |
| Use empty() instead of checking size() against zero. |
| Do not use STL containers as public base classes. |
| Never create containers of auto_ptrs. |
| Use vector and string in place of dynamically allocated arrays. |
| Where possible pre-allocate in containers to save unnecessary reallocations. |
| When passing vector types to C style functions use '&v[ 0 ]'. |
| Only use STL string's member c_str to get a const char* to use with legacy functions. |
| Do not use vector<bool>. |
| Return false for equivalent values in relational predicates. |
| Never modify the key part of a set or multiset element. |
| Minimise mixing of iterator types. |
| The result of a predicate should depend only on its parameters. |
| Use STL algorithms rather than hand-written loops. |
| Use container member functions rather than algorithms with the same name. |
| Directly include necessary STL headers. |
| Minimise use of the Standard Template Library 'auto_ptr'. |