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...

Copy-construct a weak_ptr from original.

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

Construct a weak_ptr observing the same object as other.

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

Move-construct a weak_ptr from a compatible other.

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...

Construct a weak_ptr observing the same object as other.

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

Parameters

NameDescription
originalsource object to copy or move from
otherother pointer to compare or share ownership with