Namespaces
Variants

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

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
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)

Konstruiert einen neuen polymorphic_allocator .

1) Konstruiert einen polymorphic_allocator unter Verwendung des Rückgabewerts von std:: pmr :: get_default_resource ( ) als zugrunde liegende Speicherressource.
2,3) Konstruiert einen polymorphic_allocator unter Verwendung von other. resource ( ) als zugrundeliegende Speicherressource.
4) Konstruiert einen polymorphic_allocator unter Verwendung von r als zugrundeliegende Speicherressource. Dieser Konstruktor ermöglicht eine implizite Konvertierung von std:: pmr :: memory_resource * .

Inhaltsverzeichnis

Parameter

other - ein weiterer polymorphic_allocator zum Kopieren
r - Zeiger auf die zu verwendende Speicherressource. Darf nicht null sein

Exceptions

4) Wirft nichts.

Hinweise

Das Kopieren eines Containers mit einem polymorphic_allocator ruft nicht den Kopierkonstruktor des Allokators auf. Stattdessen verwendet der neue Container den Rückgabewert von select_on_container_copy_construction (einen standardmäßig konstruierten polymorphic_allocator ) als seinen Allokator.

Siehe auch

Erstellt einen neuen polymorphic_allocator zur Verwendung durch den Kopierkonstruktor eines Containers
(öffentliche Elementfunktion)