Jump to content

C++: Difference between revisions

74 bytes removed ,  17 April
 
Line 643: Line 643:
** I.e. each object should manage it's own memory rather than the caller having to manage it.
** I.e. each object should manage it's own memory rather than the caller having to manage it.
** You should never use `malloc` and `free` unless interfacing with C libraries.
** You should never use `malloc` and `free` unless interfacing with C libraries.
* Use smart pointers instead of new and delete.
* Avoid the use of new and delete, instead using vector or smart pointers.
** Namely, <code>std::unique_ptr</code>, <code>std::shared_ptr</code>, and <code>std::vector</code>.
* Use clang-format.
* Use clang-format.