Hacker News new | ask | show | jobs
by spacedcowboy 2214 days ago
Or you could use attributes...

https://www.reddit.com/r/embedded/comments/gt8vsc/using_raii...

1 comments

Yes you can. I did mention GCC's cleanup attribute along with MSVC's try-finally construct. Another user was kind enough to even provide an example in their GitHub issue: https://github.com/taeber/cwith/issues/1.