std::move_only_function:: operator=
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
move_only_function
&
operator
=
(
move_only_function
&&
other
)
;
|
(1) | (since C++23) |
move_only_function
&
operator
=
(
const
move_only_function
&
)
=
delete
;
|
(2) | (since C++23) |
move_only_function
&
operator
=
(
std::
nullptr_t
)
noexcept
;
|
(3) | (since C++23) |
template
<
class
F
>
move_only_function & operator = ( F && f ) ; |
(4) | (since C++23) |
Assigns a new target to
std::move_only_function
or destroys its target.
std::move_only_function
, as if by executing
move_only_function
(
std::
forward
<
F
>
(
f
)
)
.
swap
(
*
this
)
;
. This overload participates in overload resolution only if the constructor of
move_only_function
from
F
participates in overload resolution. The program is ill-formed or has undefined behavior if the selected constructor call is ill-formed or has undefined behavior.
Parameters
other | - |
another
std::move_only_function
object to move the target of
|
f | - | a callable object to initialize the new target with |
Return value
* this
Notes
It is intentional not to require the move assignment operator to be
noexcept
to leave room for an allocator-aware
move_only_function
in future.
move_only_function
can be assigned from
std::
in_place_type
<
Fn
>
given it can be constructed from that argument.
Example
This section is incomplete
Reason: no example |
See also
assigns a new target
(public member function of
std::function<R(Args...)>
)
|