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

std::pmr::polymorphic_allocator::polymorphic_allocator

polymorphic_allocator();

(1)

?

polymorphic_allocator( const polymorphic_allocator& other ) = default;

(2)

?

template< class U > polymorphic_allocator( const polymorphic_allocator<U>& other );

(3)

?

polymorphic_allocator( memory_resource* r);

(4)

?

构造一个新的polymorphic_allocator...

1%29构造一个polymorphic_allocator的返回值std::pmr::get_default_resource()作为底层内存资源。

2-3%29构造polymorphic_allocator使用other.resource()作为底层内存资源。

4%29构造一个polymorphic_allocator使用r作为底层内存资源。此构造函数提供一个隐式转换。memory_resource*...

参数

other

-

another polymorphic_allocator to copy from

r

-

pointer to the memory resource to use. May not be null.

例外

1,3%29

noexcept规格:

noexcept

4%29没有抛出任何东西。

注记

使用polymorphic_allocator不会调用分配器%27s复制构造函数。相反,新容器将使用select_on_container_copy_construction%28a默认-构造polymorphic_allocator%29作为它的分配器。

另见

select_on_container_copy_construction

Create a new polymorphic_allocator for use by a container's copy constructor (public member function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com