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

Set the target of this object to the specified `rhs` callable object, destroy the previous target (if any), and return `&ast;this`&period; The result is equivalent to having constructed `&ast;this` from `std&colon;&colon;forward&lt;FUNC&gt;(rhs)` and `this&hyphen;&gt;get&lowbar;allocator()`&period; Note that this assignment operator will not participate in overload resolution if `func` is of the same type as this object (to avoid ambiguity with the copy and move assignment operators&period;) In C&plus;&plus;03, instantiation will fail unless `FUNC` is invocable with the arguments and return type specified in `PROTOTYPE`&period; In C&plus;&plus;11 and later, this assignment operator will not participate in overload resolution unless `FUNC` is invocable with the arguments and return type specified in `PROTOTYPE`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FUNC&gt;
xref:bsl/function-0a.adoc[function]&
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]#Created with https://www.mrdocs.com[MrDocs]#
