bsl::weak_ptr::weak_ptr

Constructors

Synopses

Declared in <bslstl_sharedptr.h>

Create a weak pointer in the empty state and referring to no object, i.e., a weak pointer having no representation.

constexpr
weak_ptr() noexcept;
» more...

Create a weak pointer that refers to the same object (if any) as the specified original weak pointer, and increment the number of weak references to the object managed by original (if any). Note that if original is in the empty state, this weak pointer will be initialized to the empty state.

weak_ptr(weak_ptr const& original) noexcept;
» more...

Create a weak_ptr that shares ownership with the specified other weak pointer.

template<class COMPATIBLE_TYPE>
weak_ptr(weak_ptr<COMPATIBLE_TYPE> const& other) noexcept;
» more...

Create a weak pointer that refers to the same object (if any) as the specified other compatible weak pointer, taking ownership of other's reference by move.

template<class COMPATIBLE_TYPE>
weak_ptr(weak_ptr<COMPATIBLE_TYPE>&& other) noexcept;
» more...

Create a weak pointer that refers to the same object (if any) as the specified original weak pointer, and reset original to an empty state.

weak_ptr(BloombergLP::bslmf::MovableRef<weak_ptr> original) noexcept;
» more...

Create a weak pointer that refers to the same object (if any) as the specified other (shared or weak) pointer of the (template parameter) COMPATIBLE_TYPE, and increment the number of weak references to the object managed by other (if any). If COMPATIBLE_TYPE * is not implicitly convertible to ELEMENT_TYPE *, then a compiler diagnostic will be emitted. Note that if other is in the empty state, this weak pointer will be initialized to the empty state. Create a weak_ptr that shares ownership with the specified other shared pointer.

template<class COMPATIBLE_TYPE>
weak_ptr(shared_ptr<COMPATIBLE_TYPE> const& other) noexcept;
» more...