bsl::weak_ptr::operator=

Assign to this weak_ptr from the specified arguments.

Synopsis

Declared in <bslstl_sharedptr.h>

template<class COMPATIBLE_TYPE>
weak_ptr&
operator=(weak_ptr<COMPATIBLE_TYPE>&& rhs) noexcept
requires is_convertible<COMPATIBLE_TYPE *, ELEMENT_TYPE *>::value;

Description

Make this weak pointer refer to the same object (if any) as the specified rhs weak pointer. Decrement the number of weak references to the object this weak pointer managed (if any), and reset rhs to an empty state. Return a reference providing modifiable access to this weak pointer. This function does not exist unless a pointer to (the template parameter) COMPATIBLE_TYPE is convertible to a pointer to (the template parameter) ELEMENT_TYPE. Note that if rhs is in an empty state, this weak pointer will be set to an empty state.

Return Value

reference providing modifiable access to this weak pointer

Parameters

NameDescription
rhsright-hand side operand