←back to thread

36 points tanelpoder | 10 comments | | HN request time: 0.062s | source | bottom
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 #
1. 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 #
2. CyberDildonics ◴[] No.45150286[source]
This doesn't have anything to do with what they said, they didn't say RAII was new.
replies(1): >>45150811 #
3. pjmlp ◴[] No.45150811[source]
Might be misunderstood by others not skilled in C++ when reading,

> This doesn't look like RAII. How is this idiomatic for C++20?

replies(1): >>45151455 #
4. CyberDildonics ◴[] No.45151455{3}[source]
You can try to be insulting if you want but if you could explain the connection I think you would have already.
replies(1): >>45152207 #
5. pjmlp ◴[] No.45152207{4}[source]
I wasn't.
replies(1): >>45153707 #
6. 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 #
7. CyberDildonics ◴[] No.45153707{5}[source]
You weren't what? Who are you saying "isn't skilled in C++" here and why would that matter?
replies(1): >>45155472 #
8. pjmlp ◴[] No.45155469[source]
Indeed, that is the point.
9. pjmlp ◴[] No.45155472{6}[source]
Those that by reading that sentence think RAII is something new in C++20.
replies(1): >>45162457 #
10. CyberDildonics ◴[] No.45162457{7}[source]
Why would someone who knows what RAII and C++20 are end up thinking that?