Hacker News new | ask | show | jobs
by rcfox 3544 days ago
Not everything can live on the stack.

If you're not using new/delete in C++, you're probably not doing something very complicated. (And hey, that's not necessarily a bad thing!)

2 comments

The resource manager (like std::vector or std::unique_ptr) can certainly live on the stack when the data it manages resides on the heap.
RAII can wrap heap-allocated data. Also bss-allocated objects are common.