4 ms·
That's not entirely honest. A) You still have to worry about it when interfacing with libraries that use plain pointers B) Shared pointers incur runtime penal
by Peaker 16y ago
That's not entirely honest.
A) You still have to worry about it when interfacing with libraries that use plain pointers
B) Shared pointers incur runtime penalties (larger data pushes things off the cache, spurious inc/dec-refs messing said cache. If you don't care about that, why do you use a language like C++ in the first place?
C) Reference counting is a poor form of automatic memory management, you still have to worry about cycles, and use weak references or such to break the cycles.