News for hackers. Stuff that matters.
Re:C++23 “Pandemic Edition” is complete by RcouF1uZ4gsC on Tuesday February 14, 2023 @07:42AM (#34788497)
I don’t think it takes a PhD to write an unsafe linked list in Rust. And an unsafe linked list in Rust would still be safer than the equivalent linked list in C++
Re:C++23 “Pandemic Edition” is complete by goalieca on Tuesday February 14, 2023 @08:11AM (#34788773)
How would the equivalent linked list in c++ be unsafe?

The problem with c++ was never writing simple data structures, but was writing complete programs without a single mistake in the informal contracts between functions. Static analysis tools and other crutches help but having a stricter ruleset to enforce is what makes rust a winner.

Re:C++23 “Pandemic Edition” is complete by RcouF1uZ4gsC on Tuesday February 14, 2023 @08:19AM (#34788840)
The list itself would not be unsafe, but the usages of it could be. For example, iterator invalidation, access from another thread, etc that Rust would prevent you from doing even if you used unsafe to implement the linked list.