Conversation

This Tweet was deleted by the Tweet author. Learn more
This Tweet was deleted by the Tweet author. Learn more
My view is: Shared_ptr can help with trivial refcount misuse, but that isn’t where most of the problems are. Bounds checking is helpful, but the syntactic sugar runs the wrong way ([] is unchecked). Worst: UAF is pernicious and there is very little modern C++ does to prevent it.
2
13
Replying to and
Many modern C++ constructs encourage and mask use-after-free. Using destructors for managing all resources while still using references, iterators, etc. makes that worse, not better. Features like string_view are going to amplify that even further. It mostly helps avoid leaks...
1
8
Destructors are great in a type / memory safe language, but it's even easier to create dangling references when destruction is implicit rather than explicit. I've spent a lot of time debugging these memory corruption bugs and it's so much worse to resolve with C++ than C.
1
4