2 ms·
If you are able to structure your code so there is only ever one construction order for all objects your program uses, and destruction is the reverse order, you
by londons_explore 6y ago
If you are able to structure your code so there is only ever one construction order for all objects your program uses, and destruction is the reverse order, you're pretty safe for most memory safety bugs.
Sadly as codebases get more complex, that vision gets further and further from reality.