std::function<R(Args...)>::assign (3) - Linux Manuals

std::function<R(Args...)>::assign: std::function<R(Args...)>::assign


std::function<R(Args...)>::assign - std::function<R(Args...)>::assign


template< class F, class Alloc > (since C++11)
void assign( F&& f, const Alloc& alloc ); (removed in C++17)

Initializes the target with f. alloc is used to allocate memory for any internal data structures that the function might use.
Equivalent to function(allocator_arg, alloc, std::forward<F>(f)).swap(*this)


f - callable function to initialize the target with
alloc - allocator to use to allocate memory for the internal data structures

Return value




See also

          assigns a new target
operator= (public member function)