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. Note that a shared pointer with a custom deleter can refer to a null pointer without being empty, and so may be unique. Also note that the result of this function may not be reliable in a multi‐threaded program, where a weak pointer may be locked on another thread.

Synopsis

Declared in <bslstl_sharedptr.h>

bool
unique() const noexcept;

Description

DEPRECATED: This function is deprecated in C++17 because its correctness is not guaranteed since the value returned by the used use_count function is approximate.

Created with MrDocs