std::function<R(Args...)>::assign
來自 cppreference.com
< cpp | utility | functional | function
template< class F, class Alloc > void assign( F&& f, const Alloc& alloc ); |
(C++11 起) (在 C++17 中已移除) |
|
使用 f
初始化 *target*。alloc
用於為 function
可能使用的任何內部資料結構分配記憶體。
等效於 function(std::allocator_arg, alloc, std::forward<F>(f)).swap(*this);。
目錄 |
[編輯] 引數
f | - | 可呼叫函式,用於初始化 *target* |
alloc | - | 用於為內部資料結構分配記憶體的分配器 |
[編輯] 返回值
(無)
[編輯] 異常
可能丟擲實現定義的異常。
[編輯] 參閱
賦值一個新的目標 (公共成員函式) |