Search:
Reference
<memory>
weak_ptr
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 type
definition
notes
element_type
Template 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 )
C++
Information
Tutorials
Reference
Articles
Forum
Reference
C library:
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
<cfenv> (fenv.h)
<cfloat> (float.h)
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
<ctgmath> (tgmath.h)
<ctime> (time.h)
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
Containers:
<array>
<deque>
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
<unordered_map>
<unordered_set>
<vector>
Input/Output:
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
Multi-threading:
<atomic>
<condition_variable>
<future>
<mutex>
<thread>
Other:
<algorithm>
<bitset>
<chrono>
<codecvt>
<complex>
<exception>
<functional>
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
<random>
<ratio>
<regex>
<stdexcept>
<string>
<system_error>
<tuple>
<typeindex>
<typeinfo>
<type_traits>
<utility>
<valarray>
<memory>
classes:
allocator
allocator_arg_t
allocator_traits
auto_ptr
auto_ptr_ref
bad_weak_ptr
default_delete
enable_shared_from_this
owner_less
pointer_traits
raw_storage_iterator
shared_ptr
unique_ptr
uses_allocator
weak_ptr
enum classes:
pointer_safety
functions:
addressof
align
allocate_shared
const_pointer_cast
declare_no_pointers
declare_reachable
dynamic_pointer_cast
get_deleter
get_pointer_safety
get_temporary_buffer
make_shared
return_temporary_buffer
static_pointer_cast
undeclare_no_pointers
undeclare_reachable
uninitialized_copy
uninitialized_copy_n
uninitialized_fill
uninitialized_fill_n
objects:
allocator_arg
weak_ptr
weak_ptr::weak_ptr
weak_ptr::~weak_ptr
member functions:
weak_ptr::expired
weak_ptr::lock
weak_ptr::operator=
weak_ptr::owner_before
weak_ptr::reset
weak_ptr::swap
weak_ptr::use_count
non-member overloads:
swap (weak_ptr)