2 ms·
RAII is a core fundamental feature of C++ and I would argue that constructors and destructors are the implementation. With RAII (using vector, string, unique_p
by RcouF1uZ4gsC 6y ago
RAII is a core fundamental feature of C++ and I would argue that constructors and destructors are the implementation.
With RAII (using vector, string, unique_ptr, etc), memory leaks are pretty much a solved problem in modern c++. The biggest memory danger in C++, in my opinion, is dangling references where you have a reference to an object (either on the stack or heap) that has been destructed.