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) | 
|---|
 © cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

