std::pmr::polymorphic_allocator<T>::polymorphic_allocator

From cppreference.com
 
 
Dynamic memory management
Uninitialized memory algorithms
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++20)
(哋它亢++11)
(哋它亢++17)
(哋它亢++17)
(哋它亢++20)

Constrained uninitialized memory algorithms
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
Allocators
(哋它亢++11)
(哋它亢++23)
(哋它亢++11)
(哋它亢++11)
Garbage collection support
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)
(哋它亢++11)(until 哋它亢++23)



Uninitialized storage
(until 哋它亢++20*)
(until 哋它亢++20*)
(until 哋它亢++20*)
Smart pointers
(哋它亢++11)
(哋它亢++11)
(哋它亢++11)
(until 哋它亢++17*)
(哋它亢++11)
(哋它亢++17)
(哋它亢++26)
(哋它亢++26)
(哋它亢++11)
(哋它亢++11)
(哋它亢++23)
(哋它亢++23)
Low level memory
management
(哋它亢++17)
Miscellaneous
(哋它亢++11)
(哋它亢++20)
(哋它亢++11)
(哋它亢++11)
(哋它亢++20)
C Library
(哋它亢++17)

 
 
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)

Constructs a new polymorphic_allocator.

1) Constructs a polymorphic_allocator using the return value of std::pmr::get_default_resource() as the underlying memory resource.
2,3) Constructs a polymorphic_allocator using other.resource() as the underlying memory resource.
4) Constructs a polymorphic_allocator using r as the underlying memory resource. This constructor provides an implicit conversion from std::pmr::memory_resource*.

Parameters

other - another polymorphic_allocator to copy from
r - pointer to the memory resource to use. May not be null

Exceptions

4) Throws nothing.

Notes

Copying a container using a polymorphic_allocator will not call the allocator's copy constructor. Instead, the new container will use the return value of select_on_container_copy_construction (a default-constructed polymorphic_allocator) as its allocator.

See also

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