←back to thread

36 points tanelpoder | 2 comments | | HN request time: 0.401s | source
Show context
levzettelin ◴[] No.45148093[source]

  // You are responsible for releasing the structure in the end
  arrow_array.release(&arrow_array);
This doesn't look like RAII. How is this idiomatic for C++20? Why do you have to pass a pointer to "this" again as an explicit argument.
replies(2): >>45148279 #>>45149732 #
pjmlp ◴[] No.45149732[source]
RAII predates C++98, I was already used to it in Turbo C++ for MS-DOS, and is pity we need to keep advocating for it as something extraordinary.
replies(2): >>45150286 #>>45152465 #
1. ender341341 ◴[] No.45152465[source]
I think you're partly making the point for them, RAII has been idiomatic C++ since before c++ was standardized. It wasn't even idiomatic c++98 to be missing it, so to be missing it in c++20 library definitely still isn't.
replies(1): >>45155469 #
2. pjmlp ◴[] No.45155469[source]
Indeed, that is the point.