C++ 函式庫 - assign



描述

它使用 f 初始化目標。alloc 用於為函式可能使用的任何內部資料結構分配記憶體。

宣告

以下是 std::function::assign 的宣告。

C++11

template< class F, class Alloc >

C++17

void assign( F&& f, const Alloc& alloc );

引數

  • other − 用於初始化 *this 的函式物件。

  • f − 用於初始化 *this 的可呼叫物件。

返回值

異常

functional.htm
廣告