Namespaces
Variants

std::function_ref:: operator=

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
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 对象
(公开成员函数)
替换或销毁目标对象
( std::copyable_function 的公开成员函数)
分配新目标对象
( std::function<R(Args...)> 的公开成员函数)
替换或销毁目标对象
( std::move_only_function 的公开成员函数)