bsl::function::operator=

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>

template<class FUNC>
function&
operator=(FUNC&& rhs)
requires ! IsReferenceCompatible<typename Decay<FUNC>::type, function>::value
        &&   IsInvocableWithPrototype<typename Decay<FUNC>::type>::value;