名稱空間
變體
操作

std::function<R(Args...)>::assign

來自 cppreference.com
< cpp‎ | utility‎ | functional‎ | function
 
 
 
函式物件
函式呼叫
(C++17)(C++23)
恆等函式物件
(C++20)
透明運算子包裝器
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

舊繫結器和介面卡
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)  
(直到 C++17*)
(until C++17*)(until C++17*)(until C++17*)(until C++17*)
(直到 C++20*)
(直到 C++20*)
(直到 C++17*)(直到 C++17*)
(直到 C++17*)(直到 C++17*)

(直到 C++17*)
(until C++17*)(until C++17*)(until C++17*)(until C++17*)
(直到 C++20*)
(直到 C++20*)
 
 
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 - 用於為內部資料結構分配記憶體的分配器

[編輯] 返回值

(無)

[編輯] 異常

可能丟擲實現定義的異常。

[編輯] 參閱

賦值一個新的目標
(公共成員函式) [編輯]