3 ms·
> RAII doesn't help with a generic pair of init and deinit functions, such as malloc() and free() for example, people have been writing RAII scope_exit classes
by gpderetta 6y ago
> RAII doesn't help with a generic pair of init and deinit functions, such as malloc() and free() for example,
people have been writing RAII scope_exit classes for at least 20 years to do exactly this.
> You can't do anything with RAII unless you wrap your stuff into objects which just forces the OO crap on everything regardless of whether it's a good fit for the OO paradigm.
wrapping something in an object does not make it OO. For example there is nothing object oriented about std::unique_ptr.
- saagarjha 6y agoWell, you can only wrap objects in one, although you can "wrap" a primitive by writing lambdas for this purpose.