Treffer: All Heap No Leaks.
Weitere Informationen
The use of "new" and "delete," in the programming language C++, can cause problems for both novice and expert developers alike. Using new without a coresponding delete results in a memory leak. Some languages such as C#, Java and Python provide managed objects that can be created on the managed heap leaving deletion to the garbage collector. Smart pointers allow similar behaviour to be achieved in C++, with the added bonus that they provide detemiinistic destruction of the object to which they point. However, the user still has to know that they should be using smart pointers and many don't. In this article, the author is going to look at a way of writing C++ objects that can only be created on the heap, and that must be managed by smart pointers.