Name | Checked | Synopsis |
---|
OAL#001
|
|
Only customize the memory management for a class if memory management is an unacceptably large part of the allocation and deallocation of free store objects of that class |
OAL#002
|
|
If you overload operator delete, it shall be prepared to accept a null pointer |
OAL#003
|
 |
If you overload operator new for a class, you should have a corresponding operator delete |
OAL#004
|
|
In case allocated memory has to be deallocated later by someone else, use a unique_ptr with move semantics |
OAL#005
|
 |
Assign a new value to a pointer that points to deallocated memory |
OAL#006
|
 |
delete shall be used only with new |
OAL#007
|
 |
Don't mix new and delete for array and non-array types |
OAL#008
|
 |
Do not use "delete" to delete raw pointers inside smart pointers |
OAL#009
|
 |
Do not overload the global operator new or the global operator delete |
OAL#010
|
 |
Do not overload the new and/or delete operators |
OAL#011
|
 |
Use smart pointers for memory management |
OAL#012
|
 |
Don't use auto_ptr, use unique_ptr instead |
OAL#013
|
 |
Use std::make_shared instead of constructing a shared_ptr from a raw pointer |
OAL#015
|
 |
Use nullptr instead of 0 or NULL for pointers |
OAL#017
|
 |
Use smart pointers from the standard library |
OAL#018
|
 |
Don't forget to give scoped variables a name |