[#BloombergLP-bslma-ManagedPtr-0fa-operator_assign-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

Assignment operators

== Synopses

Declared in `&lt;bslma&lowbar;managedptr&period;h&gt;`

Assign ownership from `rhs` to this managed pointer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;TARGET&lowbar;TYPE&gt;]&
xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-01f.adoc[operator&equals;](xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]& rhs) noexcept;
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-01f.adoc[_» more&period;&period;&period;_]#

Assign ownership from compatible `rhs` to this managed pointer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;TARGET&lowbar;TYPE&gt;]&
xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-013.adoc[operator&equals;](xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;BDE&lowbar;OTHER&lowbar;TYPE&gt;]&& rhs) noexcept
requires bsl&colon;&colon;is&lowbar;convertible&lt;BDE&lowbar;OTHER&lowbar;TYPE &ast;, TARGET&lowbar;TYPE &ast;&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-013.adoc[_» more&period;&period;&period;_]#

Destroy the managed object (if any) and reset this pointer to empty&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;TARGET&lowbar;TYPE&gt;]&
xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0d.adoc[operator&equals;](xref:bsl/nullptr_t-08.adoc[bsl::nullptr&lowbar;t] nullPointerLiteral);
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0d.adoc[_» more&period;&period;&period;_]#

Assign ownership from the managed pointer referenced by `ref`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;TARGET&lowbar;TYPE&gt;]&
xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0b.adoc[operator&equals;](xref:BloombergLP/bslma/ManagedPtr_Ref.adoc[ManagedPtr&lowbar;Ref&lt;TARGET&lowbar;TYPE&gt;] ref) noexcept;
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0b.adoc[_» more&period;&period;&period;_]#

Assign ownership from `rhs` to this managed pointer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr&lt;TARGET&lowbar;TYPE&gt;]&
xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0c.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;ManagedPtr&gt;] rhs) noexcept;
----

[.small]#xref:BloombergLP/bslma/ManagedPtr-0fa/operator_assign-0c.adoc[_» more&period;&period;&period;_]#

== Return Value

reference to this managed pointer

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| managed pointer from which to take ownership
| *nullPointerLiteral*
| null&hyphen;pointer literal (unused&semi; selects this overload)
| *ref*
| managed&hyphen;pointer reference from which to take ownership
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
