logoalt Hacker News

feelameeyesterday at 1:52 PM1 replyview on HN

if you do it once - why do you care about "ugly" scope_exit? btw, writing such wrappers is easy and does not require a lot of code.


Replies

mort96yesterday at 2:14 PM

What do you mean with '"ugly" scope_exit'?

Do you mean why I care that I have to call the free function at every exit point of the scope? That's easy: because it's error prone. Defer is much less error prone.