-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
C++ Memory Management
By :
Enjoying yourself so far? I hope you are! We are at the point where we hold all the keys and can start to do what this book advertises and look in more detail at how memory management works in C++. It’s not a simple topic, nor is it something trivial, so we needed to make sure we were ready… but we are now, so let’s do it!
Chapter 5 and Chapter 6 examined the standard tools one can use to ensconce responsibility over dynamically allocated resources into the C++ type system through smart pointers, the ones provided by the standard as well as those we could write to fill other niches. Using smart pointers instead of raw pointers as data members and function return types tends to simplify (and clarify) a significant proportion of memory management tasks in C++ programs.
Sometimes, we want to work at a lower level than this and take control over what happens when someone writes new X. The reasons for wanting such control...