在线文档教程
C++
应用 | Utilities

std::function::assign

STD::功能::分配

template< class F, class Alloc > void assign( F&& f, const Alloc& alloc (since C++11) (until C++17)

初始化目标带着f...alloc对象的任何内部数据结构分配内存。function可能会用。

相当于function(allocator_arg, alloc,std::forward<F>(f)).swap(*this)...

参数

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

返回值

%280%29

例外

%280%29

另见

operator=assigns a new target (public member function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cpPreference.com/w/cpp/实用程序/FunctionalFunctionalAscription