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

Return `true` if this shared pointer is not empty and does not share ownership of the object it managed with any other shared pointer, and `false` otherwise&period; Note that a shared pointer with a custom deleter can refer to a null pointer without being empty, and so may be `unique`&period; Also note that the result of this function may not be reliable in a multi&hyphen;threaded program, where a weak pointer may be locked on another thread&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
unique() const noexcept;
----

== Description

DEPRECATED&colon; This function is deprecated in C&plus;&plus;17 because its correctness is not guaranteed since the value returned by the used `use&lowbar;count` function is approximate&period;


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