News for hackers. Stuff that matters.
Re:We used C++20 to eliminate a class of runtime bugs by leetcrew on Friday January 14, 2022 @11:00AM (#29936061)
in my experience, it's almost inevitable that you end up calling some code you don't control that returns raw pointers. better hope you have access to the source or at least some good docs :)
Re:We used C++20 to eliminate a class of runtime bugs by maccard on Friday January 14, 2022 @11:55AM (#29936901)
Agreed. That problem existed even before unique_ptr though; there are still some APIs that I use that hand you back pointers that you may or may not need to manage yourself. If you do need to, then unique_ptr + custom deleter is the way to go!