std::experimental::function<R(Args...)>:: operator=
|
function
&
operator
=
(
const
function
&
other
)
;
|
(1) | (库基础技术规范) |
|
function
&
operator
=
(
function
&&
other
)
;
|
(2) | (库基础技术规范) |
|
function
&
operator
=
(
std::
nullptr_t
)
noexcept
;
|
(3) | (库基础技术规范) |
|
template
<
class
F
>
function & operator = ( F && f ) ; |
(4) | (库基础技术规范) |
| (5) | ||
|
template
<
class
F
>
function & operator = ( std:: reference_wrapper < F > f ) ; |
(库基础技术规范) | |
|
template
<
class
F
>
function & operator = ( std:: reference_wrapper < F > f ) noexcept ; |
(库基础技术规范 v3) | |
为
std::experimental::function
分配新的
目标对象
。在以下描述中,令
ALLOCATOR_OF
(
f
)
表示构造
f
时指定的分配器,若未指定分配器,则取构造时
std::
experimental
::
pmr
::
get_default_resource
(
)
的值
(库基础技术规范 v3 前)
默认构造的
std::
pmr
::
polymorphic_allocator
<>
值
(库基础技术规范 v3 起)
。
get_memory_resource()
返回的内存资源与赋值前等效,但其地址可能发生改变。
Args...
和返回类型
R
满足
Callable
要求时,此运算符才参与重载决议。
目录 |
参数
| other | - |
另一个用于复制或移动来源的
std::experimental::function
对象
|
| f | - | 用于初始化 目标 的可调用对象 |
| 类型要求 | ||
-
F
必须满足
Callable
的要求。
|
||
返回值
* this
异常
注释
移动赋值运算符可能需要分配存储,如果 get_memory_resource ( ) ! = other. get_memory_resource ( ) (until library fundamentals TS v3) get_allocator ( ) ! = other. get_allocator ( ) (library fundamentals TS v3)