function::assign

分配给该函数对象的可调用的对象。

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
);

参数

  • _Func
    可调用的对象。

  • _Fnref
    包含一个可调用对象的引用包装。

  • _Ax
    分配器对象。

备注

该成员函数每个成员将用作 operand传递的可调用的对象替换 *this 挂起的 callable object。两个随分配器对象 _Ax的存储。

要求

标头: <functional>

命名空间: std

请参见

参考

function Class

mem_fn Function

Lvalue和Rvalues

reference_wrapper Class