42 ms·
> No one is suggesting this. At least one person in this thread is, in fact, suggesting this: https://news.ycombinator.com/item?id=15524405 https://news.ycombi
by kentonv 9y ago
> No one is suggesting this.
At least one person in this thread is, in fact, suggesting this: https://news.ycombinator.com/item?id=15524405 https://news.ycombinator.com/item?id=15524405
> They are saying that you use an RAII class such that it doesn't need tear down.
Yes, as I said in my original comment: "Of course, ideally state is encapsulated in classes with destructors and tear-down happens there, but writing a whole class can often be overkill for a one-off use case. If you don't have a defer macro, you're going to get lazy and introduce bugs."
I do know how destructors work, thanks.
- quietbritishjim 9y agoI guess I took your comment the wrong way. Sorry about that.