[#bsl-function-0a-operator_assign-03] = xref:bsl.adoc[bsl]::xref:bsl/function-0a.adoc[function]::operator= :relfileprefix: ../../ :mrdocs: Set the target of this object to the specified `rhs` callable object, destroy the previous target (if any), and return `*this`. The result is equivalent to having constructed `*this` from `std::forward<FUNC>(rhs)` and `this‐>get_allocator()`. 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.) In C++03, instantiation will fail unless `FUNC` is invocable with the arguments and return type specified in `PROTOTYPE`. In C++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`. == Synopsis Declared in `<bslstl_function.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNC> xref:bsl/function-0a.adoc[function]& operator=(FUNC&& rhs) requires ! IsReferenceCompatible<typename Decay<FUNC>::type, function>::value && IsInvocableWithPrototype<typename Decay<FUNC>::type>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#