std::shared_ptr::unique

From Cppreference

Jump to: navigation, search
bool unique() const;

Checks if *this is the only shared_ptr instance managing the current object, i.e. whether use_count() == 1.

Contents

[edit] Parameters

(none)

[edit] Return value

true if *this is the only shared_ptr instance managing the current object, false otherwise.

[edit] Example

[edit] See also

use_count
returns the number of shared_ptr objects referring to the same managed object
(public member function)