class template

<memory>

std::weak_ptr

template <class T> class weak_ptr;

Weak shared pointer

[under construction

Template parameters

T
The type of the weakly managed object, aliased as member type element_type.

Member types

The following alias is a member type of weak_ptr.
member typedefinitionnotes
element_typeTemplate parameter (T)The type of the weakly managed object

Member functions

(constructor)
Construct weak_ptr (public member function)
(destructor)
Destroy weak_ptr (public member function)
operator=
weak_ptr assignment (public member function)
swap
Swap content (public member function)
reset
Reset pointer (public member function)
use_count
Use count (public member function)
expired
Check if expired (public member function)
lock
Lock and restore weak_ptr (public member function)
owner_before
Owner-based ordering (public member function template)

Non-member functions

Overloads:
swap
Exchange content of weak_ptr objects (function template)

See also

shared_ptr
Shared pointer (class template)
owner_less
Owner-based less-than operation (class template)