std::function<R(Args...)>::assign
来自 cppreference.cn
< cpp | utility | functional | function
template< class F, class Alloc > void assign( F&& f, const Alloc& alloc ); |
(自 C++11 起) (在 C++17 中移除) |
|
用 f
初始化目标。 alloc
用于为 function
可能使用的任何内部数据结构分配内存。
等效于 function(std::allocator_arg, alloc, std::forward<F>(f)).swap(*this);。
目录 |
[编辑] 参数
f | - | 用于初始化目标的可调用函数 |
alloc | - | 用于为内部数据结构分配内存的分配器 |
[编辑] 返回值
(无)
[编辑] 异常
可能抛出实现定义的异常。
[编辑] 参见
赋值新的目标 (公共成员函数) |