Return a "snapshot" of the current number of shared pointers that share ownership of the object referred to by this weak pointer, or 0 if this weak pointer is in the empty state. Note that any result other than 0 may be unreliable in a multi‐threaded program, where another pointer sharing ownership in a different thread may be copied or destroyed, or another weak pointer may be locked in the case that 1 is returned (that would otherwise indicate unique ownership).
Synopsis
Declared in <bslstl_sharedptr.h>
long
use_count() const noexcept;
Created with MrDocs