Assign a new callable target from the specified rhs and return *this.
Synopsis
Declared in <bslstl_function.h>
template<class FUNC>
function&
operator=(FUNC&& rhs)
requires ! IsReferenceCompatible<typename Decay<FUNC>::type, function>::value
&& IsInvocableWithPrototype<typename Decay<FUNC>::type>::value;
Description
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.
Return Value
reference providing modifiable access to this object
Parameters
Name |
Description |
rhs |
callable object to install as the new target |
Created with MrDocs