C++ Smart Pointers: Types, Usage, and Practices
In today’s article, we will revisit smart pointers in C++. In resource management in C++, manually using <span>new</span>/<span>delete</span> can easily lead to memory leaks, dangling pointers, and exception safety issues. The smart pointers introduced in C++11 encapsulate ordinary pointers with RAII (Resource Acquisition Is Initialization): automatically releasing resources when the object goes out of scope, … Read more