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
初始化目標。用 alloc
為 function
會使用的任何內部數據結構分配內存。
等價於 function(std::allocator_arg, alloc, std::forward<F>(f)).swap(*this);。
目錄 |
[編輯] 參數
f | - | 用以初始化目標的可調用函數 |
alloc | - | 用於為內部數據結構分配內存的分配器 |
[編輯] 返回值
(無)
[編輯] 異常
可能會拋出由實現定義的異常。
[編輯] 參閱
賦值新的目標 (公開成員函數) |