C++ Functional Library - Operator


Advertisements

Description

It is used to assign the new target.

Declaration

Following is the declaration for function::operator=

C++11

The following function is assigning a copy of target of other, as if by executing function(other).

function& operator=( const function& other );

Exceptions

none

Function Moving

The following function is moving the target of other to *this. other is in a valid state with an unspecified value.

function& operator=( function&& other );

Exceptions

none

Drops the current target

The following function is droping the current target. *this is empty after the call.

function& operator=( std::nullptr_t );

Exceptions

noexcept:noexcept specification.

Sets the target

The following functions are seting the target of *this to the callable f.

template< class F >
function& operator=( F&& f );

template< class F > 
function& operator=( std::reference_wrapper f )

Exceptions

noexcept:noexcept specification.

Parameters

  • other − This function object used to initialize *this.

  • f − a callable used to initialize *this.

functional.htm
Advertisements