std::function::assign

From cppreference.com
< cpp‎ | utility‎ | functional‎ | function
 
 
 
Function objects
Function wrappers
(C++11)
(C++11)
(C++17)
Bind
(C++11)
(C++11)
(C++11)
Reference wrappers
(C++11)(C++11)
Operator wrappers
Negators
Deprecated binders and adaptors
(until C++17)
(until C++17)
(until C++17)
(until C++17)
(until C++17)(until C++17)(until C++17)(until C++17)
(until C++17)
(until C++17)(until C++17)(until C++17)(until C++17)
(until C++17)(until C++17)
(until C++17)(until C++17)
 
 
template< class F, class Alloc >
void assign( F&& f, const Alloc& alloc );
(since C++11)
(until C++17)

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

Equivalent to function(allocator_arg, alloc, std::forward<F>(f)).swap(*this)

Contents

[edit] Parameters

f - callable function to initialize the target with
alloc - allocator to use to allocate memory for the internal data structures

[edit] Return value

(none)

[edit] Exceptions

(none)

[edit] See also

assigns a new target
(public member function)