std::pmr::polymorphic_allocator<T>::polymorphic_allocator
< cpp | memory | polymorphic allocator
|
polymorphic_allocator() noexcept;
|
(1) | |
|
polymorphic_allocator( const polymorphic_allocator& other ) = default;
|
(2) | |
|
template< class U >
polymorphic_allocator( const polymorphic_allocator<U>& other ) noexcept; |
(3) | |
|
polymorphic_allocator( std::pmr::memory_resource* r );
|
(4) | |
构造新的 polymorphic_allocator。
2,3) 以 other.resource() 为底层内存资源构造
polymorphic_allocator。参数
| other | - | 要复制的另一 polymorphic_allocator |
| r | - | 指向要使用的内存资源的指针。不可为空。 |
异常
4) 不抛出任何异常。
注解
复制使用 polymorphic_allocator 的容器不会调用分配器的复制构造函数。新容器会替代地以 select_on_container_copy_construction 的返回值(默认构造的 polymorphic_allocator)为其分配器。
参阅
为容器的复制构造函数的使用创建一个新的 polymorphic_allocator(公开成员函数) |