4 ms·
Well, yeah, a language feature to improve program correctness won't work if you use it wrong. But in both examples, just from the interfaces, this should be cau
by greiskul 3y ago
Well, yeah, a language feature to improve program correctness won't work if you use it wrong. But in both examples, just from the interfaces, this should be caught in code review without even having to read the libraries being called. Anytime you take a raw pointer to a smart pointer owned object, you should question yourself, what happens to the lifetime of my object. Because you just took the safety off C++s classic footgun of memory management, and if you are not extremely careful, you are going to lose a foot.