首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::function::assign

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)

代码语言:txt
复制
 © cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券