Category Memory Management

Lesson #4: Smart Pointers

One big change to modern C++ style that comes with C++11 is that you should never need to manually delete (or free) anymore, thanks to the new classes shared_ptr, unique_ptr and weak_ptr. Note that before C++11, C++ did have one smart pointer class – auto_ptr. This was unsafe and is now deprecated, with unique_ptr replacing […]