function::assign

Assigns a callable object to this function object.

template<class Fx, class Alloc>
    void assign(
        Fx _Func, 
        const Alloc& _Ax
);
template<class Fx, class Alloc>
    void assign(
        reference_wrapper<Fx> _Fnref, 
        const Alloc& _Ax
);

Parameters

  • _Func
    A callable object.

  • _Fnref
    A reference wrapper that contains a callable object.

  • _Ax
    An allocator object.

Remarks

The member functions each replace the callable object held by *this with the callable object passed as the operand. Both allocate storage with the allocator object _Ax.

Requirements

Header: <functional>

Namespace: std

See Also

Reference

function Class

mem_fn Function

Lvalues and Rvalues

reference_wrapper Class

Other Resources

<functional> Members