News for hackers. Stuff that matters.
Re:Why Not Just Do Simple C++ RAII in C? by rcxdude on Thursday May 23, 2024 @06:25AM (#40452891)
That's not RAII, that's 'defer'. defer and context managers are both implementations of a subset of the kind of functionality you can get with RAII (the two missing parts are 1) allowing you to place an RAII object in part of a larger structure and have confidence it will actually be constructed and destructed correctly, and 2) allowing the representation of lifetimes which are more complex then just 'in this scope' via moves and copies).

There are no comments on this comment yet.