std::function_ref::operator=
來自 cppreference.com
< cpp | 工具 | 函式物件 | function ref
constexpr function_ref& operator=( const function_ref& ) noexcept = default; |
(1) | (C++26 起) |
template< class T > constexpr function_ref& operator=( T ) = delete; |
(2) | (C++26 起) |
1) 複製賦值運算子被顯式預設。`std::function_ref` 滿足 `copyable` 和 TriviallyCopyable。這個預設的賦值運算子執行儲存的 `thunk-ptr` 和 `bound-entity` 的淺複製。
2) 如果 T 與 `std::function_ref` 型別不同,std::is_pointer_v<T> 為 false,且 T 不是 std::nontype_t 的特化,則使用者定義的賦值運算子被顯式刪除。此過載僅在滿足上述條件時參與過載決議。
[編輯] 返回值
*this
[編輯] 參閱
構造一個新的 `function_ref` 物件 (public 成員函式) | |
替換或銷燬目標 ( std::copyable_function 的 public 成員函式) | |
賦值一個新的目標 ( std::function<R(Args...)> 的 public 成員函式) | |
替換或銷燬目標 ( std::move_only_function 的 public 成員函式) |