std::function<R(Args...)>::assign
From 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<R(Args...)>(std::allocator_arg, alloc, std::forward<F>(f)).swap(*this);と同等です。
目次 |
[編集] パラメータ
| f | - | ターゲットを初期化するために使用される呼び出し可能な関数 |
| alloc | - | 内部データ構造のメモリを割り当てるために使用されるアロケータ |
[編集] 戻り値
(なし)
[編集] 例外
実装定義の例外をスローする場合があります。
[編集] 関連項目
| 新しいターゲットを代入する (public member function) |