[#bsl-shared_ptr-0a-use_count]
= xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]::use&lowbar;count
:relfileprefix: ../../
:mrdocs:

Return a &quot;snapshot&quot; of the number of shared pointers (including this one) that share ownership of the object managed by this shared pointer&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;sharedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
long
use&lowbar;count() const noexcept;
----

== Description

Return a &quot;snapshot&quot; of the number of shared pointers (including this one) that share ownership of the object managed by this shared pointer&period; Note that 0 is returned if this shared pointer is empty&period; Also note that any result other than 0 may be unreliable in a multi&hyphen;threaded program, where another pointer sharing ownership in a different thread may be copied or destroyed, or a weak pointer may be locked in the case that 1 is returned (that would otherwise indicate unique ownership)&period;

== Return Value

number of shared pointers sharing ownership of the managed object


[.small]#Created with https://www.mrdocs.com[MrDocs]#
