> If they mean defer + deinit methods, that's not the same thing.
No? It's the first thing that came to my mind when I've read RAII.
> If they mean defer + deinit methods, that's not the same thing.
No? It's the first thing that came to my mind when I've read RAII.
You have to call defer after initialization so you can’t technically call it RAII. As long as you remember to call it then it is effectively the same. Personally defer makes it so very similar to be a difference without a distinction but the “is initialization” part can’t be true if you need to do a second step.