4 ms·
It's as close to a universal solution as you're going to get without a much more intrusive runtime. Obj-C and Python seem to get along just fine with it. I'd sa
by cageface 15y ago
It's as close to a universal solution as you're going to get without a much more intrusive runtime. Obj-C and Python seem to get along just fine with it. I'd say that shared_ptr removes a lot more complexity than it adds in most code. What kind of impedance mismatch do you see with pass-by-value? You should be passing shared_ptr by value.
One of the things I like about C++ is that it gives me choices and I still use raw pointers sometimes but shared_ptr removes a lot of manual memory management noise and makes it much easier to write robust, correct, exception-safe code.