Distinguish between pointers and references | ||
Prefer C++-style casts | ||
Never treat arrays polymorphically | ||
Avoid gratuitous default constructors | ||
Be wary of user-defined conversion functions | ||
Distinguish between prefix and postfix forms of increment and decrement operators | ||
Never overload && , || , or , | ||
Understand the different meanings of new and delete | ||
Use destructors to prevent resource leaks | ||
Prevent resource leaks in constructors | ||
Prevent exceptions from leaving destructors | ||
Understand how throwing an exception differs from passing a parameter or calling a virtual function | ||
Catch exceptions by reference | ||
Use exception specifications judiciously | ||
Understand the costs of exception handling | ||
Remember the 80-20 rule | ||
Consider using lazy evaluation | ||
Amortize the cost of expected computations | ||
Understand the origin of temporary objects | ||
Facilitate the return value optimization | ||
Overload to avoid implicit type conversions | ||
Consider using op= instead of stand-alone op | ||
Consider alternative libraries | ||
Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI | ||
Virtualizing constructors and non-member functions | ||
Limiting the number of objects of a class | ||
Requiring or prohibiting heap-based objects | ||
Smart pointers | ||
Reference counting | ||
Proxy classes | ||
Making functions virtual with respect to more than one object | ||
Program in the future tense | ||
Make non-leaf classes abstract | ||
Understand how to combine C++ and C in the same program | ||
Familiarize yourself with the language standard | ||