logoalt Hacker News

Gupie12/07/20251 replyview on HN

Open a file in the constructor, close it in the destructor. RAII with 0 allocations.


Replies

dh202212/08/2025

std::vector<int> allocated and freed on the stack will allocate an array for its int’s on the heap…

show 2 replies