Shared_ptr<T>: the (not always) atomic reference counted smart pointer (2019)
shared_ptr<T>: the (not always) atomic reference counted smart pointer Introduction This is a write-up of the “behavioral analysis” of shared_ptr<T> reference count in GNU’s libstdc++. This smart pointer is used to share references to the same underlaying pointer. The mechanism beneath works by tracking the amount of references through a reference count so the pointer gets freed only after the last reference is destructed. It is usually used in multi-threaded programs (in conjunction with oth