C++ Functional Library - assign


Description

It initializes the target with f. alloc is used to allocate memory for any internal data structures that the function might use.

Declaration

Following is the declaration for std::function::assign.

C++11

template< class F, class Alloc >

C++17

void assign( F&& f, const Alloc& alloc );

Parameters

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

  • f − a callable used to initialize *this.

Return Value

none

Exceptions

none

functional.htm
Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements