operator=
描述 (Description)
它用于分配新目标。
声明 (Declaration)
以下是function :: operator =的声明
C++11
以下函数分配其他目标的副本,就好像通过执行函数(其他)一样。
function& operator=( const function& other );
异常 (Exceptions)
没有
功能移动
以下函数将其他目标移动到* this。 other处于具有未指定值的有效状态。
function& operator=( function&& other );
异常 (Exceptions)
没有
丢弃当前目标
以下函数正在删除当前目标。 *通话结束后这是空的。
function& operator=( std::nullptr_t );
异常 (Exceptions)
noexcept:noexcept规范。
设置目标
以下函数将* this的目标设置为可调用f。
template< class F >
function& operator=( F&& f );
template< class F >
function& operator=( std::reference_wrapper<f> f )
</f>
异常 (Exceptions)
noexcept:noexcept规范。
参数 (Parameters)
other - 此函数对象用于初始化* this。
f - 用于初始化* this的callable。