I think Bubba means that he finds an explicit rule about avoiding heap objects superfluous, because he formulates the same rule in a positive way: use the right tool for the right job.
But having...
Type: Posts; User: CornedBee
I think Bubba means that he finds an explicit rule about avoiding heap objects superfluous, because he formulates the same rule in a positive way: use the right tool for the right job.
But having...
I think there's room for misunderstanding here.
It is preferable that any function that allocates memory also frees it before it returns. However, sometimes memory (or any other resource) must...
Use RAII religiously. Don't allocate any resource that isn't released by a destructor.
Once you really do that, the only remaining problem comes from owner cycles. To avoid these, do as Elysia...