3 ms·
> Not because refcounting adds a tiny bit of overhead, I think you may occasionally find the overhead is more than tiny. Especially when you consider that sha
by asveikau 11y ago
> Not because refcounting adds a tiny bit of overhead,
I think you may occasionally find the overhead is more than tiny. Especially when you consider that shared_ptr should also be doing atomics to keep things thread safe.
Anyway, I've heard similar recommendations against overuse of shared_ptr for various reasons and I understand them. But I think it's interesting that one community's recommendations can completely contradict another's. This is before taking into consideration the diverse opinions on what the "proper" C++ is. Compare the C++ world to say, the objc world, where in the latter, everything is refcounted by default, and ARC gives you the equivalent of shared_ptr everywhere all the time. They don't seem to mind.