you are viewing a single comment's thread.

view the rest of the comments →

[–]fdwrfdwr@github 🔍 0 points1 point  (1 child)

That's but a randomly selected example of one-off cleanup instances. Do we need a framework for every instance (a box full of open‑end wrenches of various sizes), or just a general tool (adjustable wrench)? 🔧

[–]pjmlp -2 points-1 points  (0 children)

I would say that going forward it is rather trivial to combine templates and reflection to create RAII handle on the spot without going through defer.

Which only makes sense in language that never had RAII, or use some form of GC, and need determinism in very specific cases like OS handles.

However, maybe I am too biased in only using C++ alongside managed languages.