std::function_ref::operator=
来自 zh.cppreference.net
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
的公开成员函数)
|