Assignment operators

Synopses

Declared in <bslma_managedptr.h>

Assign ownership from rhs to this managed pointer.

Assign ownership from compatible rhs to this managed pointer.

template<class BDE_OTHER_TYPE>
ManagedPtr<TARGET_TYPE>&
operator=(ManagedPtr<BDE_OTHER_TYPE>&& rhs) noexcept
requires bsl::is_convertible<BDE_OTHER_TYPE *, TARGET_TYPE *>::value;

Destroy the managed object (if any) and reset this pointer to empty.

Assign ownership from the managed pointer referenced by ref.

Assign ownership from rhs to this managed pointer.

Return Value

reference to this managed pointer

Parameters

Name

Description

rhs

managed pointer from which to take ownership

nullPointerLiteral

null‐pointer literal (unused; selects this overload)

ref

managed‐pointer reference from which to take ownership

Created with MrDocs