std::unique_ptr::operator bool

From Cppreference

Jump to: navigation, search
explicit operator bool() const;
(since C++11)

Checks whether *this owns an object, i.e. whether get() == nullptr.

Contents

[edit] Parameters

(none)

[edit] Return value

true if *this owns an object, false otherwise.

[edit] Exceptions

noexcept specification:  
noexcept

  (since C++11)

[edit] Example

[edit] See also

returns a pointer to the managed object
(public member function)