[#bsl-function-0a-operator_assign-01]
= xref:bsl.adoc[bsl]::xref:bsl/function-0a.adoc[function]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Assignment operators

== Synopses

Declared in `&lt;bslstl&lowbar;function&period;h&gt;`

Copy&hyphen;assign the target from `rhs` and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/function-0a.adoc[bsl::function&lt;PROTOTYPE&gt;]&
xref:bsl/function-0a/operator_assign-0f0f.adoc[operator&equals;](xref:bsl/function-0a.adoc[function] const& rhs);
----

[.small]#xref:bsl/function-0a/operator_assign-0f0f.adoc[_» more&period;&period;&period;_]#

Set this object to empty and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/function-0a.adoc[bsl::function&lt;PROTOTYPE&gt;]&
xref:bsl/function-0a/operator_assign-08.adoc[operator&equals;](xref:bsl/nullptr_t-08.adoc[nullptr&lowbar;t] unused) noexcept;
----

[.small]#xref:bsl/function-0a/operator_assign-08.adoc[_» more&period;&period;&period;_]#

Move&hyphen;assign the target from `rhs` and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/function-0a.adoc[bsl::function&lt;PROTOTYPE&gt;]&
xref:bsl/function-0a/operator_assign-0f04.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;function&gt;] rhs);
----

[.small]#xref:bsl/function-0a/operator_assign-0f04.adoc[_» more&period;&period;&period;_]#

Assign from a `reference&lowbar;wrapper` target and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FUNC&gt;
xref:bsl/function-0a.adoc[function]&
xref:bsl/function-0a/operator_assign-05.adoc[operator&equals;](bsl::reference&lowbar;wrapper&lt;FUNC&gt; rhs) noexcept
requires IsInvocableWithPrototype&lt;typename Decay&lt;FUNC&gt;&colon;&colon;type&gt;&colon;&colon;value;
----

[.small]#xref:bsl/function-0a/operator_assign-05.adoc[_» more&period;&period;&period;_]#

Assign a new callable target from the specified `rhs` and return `&ast;this`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FUNC&gt;
xref:bsl/function-0a.adoc[function]&
xref:bsl/function-0a/operator_assign-03.adoc[operator&equals;](FUNC&& rhs)
requires ! IsReferenceCompatible&lt;typename Decay&lt;FUNC&gt;&colon;&colon;type, function&gt;&colon;&colon;value
        &amp;&amp;   IsInvocableWithPrototype&lt;typename Decay&lt;FUNC&gt;&colon;&colon;type&gt;&colon;&colon;value;
----

[.small]#xref:bsl/function-0a/operator_assign-03.adoc[_» more&period;&period;&period;_]#

== Return Value

reference providing modifiable access to this object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| function whose target is copied into this object
| *unused*
| null pointer literal selecting the empty state
|===


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