Item-52 Write placement delete if you write placement new
· โ˜• 5 min read

When we write a placement version of operator new, be sure to write the corresponding placement version of operator delete to avoid subtle, intermittent memory leaks. When we do so, pay attention not to unintentionally hide the normal versions of new and delete


Item-51 Adhere to convention when writing new and delete
· โ˜• 4 min read

operator new should contain an infinite loop trying to allocate memory, should call the new-handler if it can’t satisfy a memory request, and should handle requests for zero bytes; class-specific versions should handle requests for larger blocks than expected. operator delete should do nothing if passed a pointer that is null; class specific versions should handle blocks that are larger than expected.


Item-48 Be aware of template metaprogramming
· โ˜• 5 min read

Template metaprogramming can shift work from runtime to compile-time (thus enabling earlier error dettection and higher runtime performance), can be used to generate custom code based on combinations of policy choices, and can also be used to avoid generating code inappropriate for particular types.