By Nicholas Solter on May 17, 2007
Why Do I Need Smart Pointers?
Working with dynamically allocated memory in languages like C++ can be difficult. If you allocate some memory and forget to free it, you get a memory leak. But if you free it more than once you get memory corruption. Not surprisingly, memory management errors are a significant source of bugs in many C++ programs.
Now imagine if you could dynamically allocate memory and use it in your program without ever worrying about freeing it! No, I’m not suggesting you switch to Java. You can obtain this ease-of-use in C++ too, simply by using smart pointers.[Read More]