Earlier quoted context omitted.
> If you imagine destructors have something to do with memory management, you have much yet to learn. It is very limiting to think that destructors is the only way to solve resource scoping problem.
What alternative doesn’t add failure opportunities and require additional work by the developer where they will crop up? Both defer (and more generally scope guards) and context managers certainly do, to say nothing of try/finally.
Outside HN, CppCon and C++Now bubbles not all C++ codebases are as clean as we would wish them to be.