3 ms·
> C++ does sort of have a safe subset. The “sort of” is what matters though: - With std::unique_ptr, you trade use-after-free for use-after-move. Rarer, but s
by littlestymaar 6y ago
> C++ does sort of have a safe subset.
The “sort of” is what matters though:
- With std::unique_ptr, you trade use-after-free for use-after-move. Rarer, but still a threat.
- std::shared_ptr is costly which makes it unsuitable for some uses, and you can still have data rave with it if you don't use it correctly.