Re:C++23 “Pandemic Edition” is complete
by karmakurtisaani on Tuesday February 14, 2023 @07:20AM
(#34788322)
Linked lists are complicated. You can get something that compiles easily with C++, but to be sure it doesn't leak memory might require you to get that PhD after all.
[ Parent
| on HN ]
Re:C++23 “Pandemic Edition” is complete
by pclmulqdq on Tuesday February 14, 2023 @07:29AM
(#34788390)
Linked lists are a very simple data structure, and pretty much everyone can get them right. There haven't been any big memory safety CVEs to my knowledge around linked list manipulation. The same for binary trees.
These pointer-based data structures are used a lot when you are manipulating large structs in C and C++, as they let you "move" then between data structures without copying a ton of memory.
Re:C++23 “Pandemic Edition” is complete
by planede on Tuesday February 14, 2023 @07:38AM
(#34788465)
It's not exactly rocket science or even PhD worthy, but getting basic exception safety right around manual memory management can get tricky.
Re:C++23 “Pandemic Edition” is complete
by lenkite on Wednesday February 15, 2023 @07:21AM
(#34802843)
Well..implementing them in "safe" Rust is not just tricky - it requires a super-brain.
You can use unsafe in Rust to get basically the same guarantees for your simple linked list as in C++?
Re:C++23 “Pandemic Edition” is complete
by jcdentonunatco on Tuesday February 14, 2023 @11:06AM
(#34791347)
If you need a PhD to avoid memory leaks, stop coding immediately, you don’t know what you are doing