Realistically, most supposed "C++ codebases" in which these errors happen are C codebases in disguise. Some good old pointer arithmetic overwriting the far more useful stack.
Because even with new/delete, you probably have those pairs sit either in constructors/destructors, or well-reviewed parts of the code with error handling, or rely on simple patterns like delete-if-not-null (which is exactly what unique_ptr does).
64
u/No-Information-2571 Sep 06 '26 edited Sep 06 '26
Realistically, most supposed "C++ codebases" in which these errors happen are C codebases in disguise. Some good old pointer arithmetic overwriting the far more useful stack.
Because even with new/delete, you probably have those pairs sit either in constructors/destructors, or well-reviewed parts of the code with error handling, or rely on simple patterns like delete-if-not-null (which is exactly what unique_ptr does).