Hacker News new | ask | show | jobs
by vilya 5298 days ago
> Since creating an object requires specifically allocating it on the heap, having it destruct when the pointer leaves scope is no good.

It is actually possible for compilers to help out with this in many cases: http://en.wikipedia.org/wiki/Escape_analysis