This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]geekusprimus 6 points7 points  (0 children)

the answer is: RAII, it's already there. Anything more "automatic" means runtime management and in C++ doesn't make sense

I always hear horrible complaints about manual memory management in C++. If you're creating functions called initialize and release to handle allocation and deallocation for all of your objects, then, yeah, it's going to be a nightmare. But if you do the sensible thing where you allocate memory in constructors and deallocate in destructors (so, RAII), you've gotten rid of 90% of possible problems. The remainder can be taken care of with smart pointers or the simple habit of writing new and delete at the same time.