<div class="t-tr-text">Concepts C + +:<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">C++ concepts:</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> Allocator
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
You can help to correct and verify the translation. Click here for instructions.
std::string, std::vector, et tous les conteneurs sauf std::array, à std::shared_ptr et std::function, le fait à travers un Allocator: un objet d'un type de classe qui satisfait aux exigences suivantes .std::string, std::vector, and every container except std::array, to std::shared_ptr and std::function, does so through an Allocator: an object of a class type that satisfies the following requirements.You can help to correct and verify the translation. Click here for instructions.
std::allocator_traits, pas directement .std::allocator_traits, not directly.You can help to correct and verify the translation. Click here for instructions.
Exigences
You can help to correct and verify the translation. Click here for instructions.
A, un allocateur pourTtypeOriginal:A, an Allocator for typeTThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.B, l'allocateur de même pourUtypeOriginal:B, the same Allocator for typeUThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.ptr, une valeur de type deallocator_traits<A>::pointer, obtenu en composantallocator_traits<A>::allocate()Original:ptr, a value of typeallocator_traits<A>::pointer, obtained by callingallocator_traits<A>::allocate()The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.cptr, une valeur de type deallocator_traits<A>::const_pointer, obtenue par conversion deptrOriginal:cptr, a value of typeallocator_traits<A>::const_pointer, obtained by conversion fromptrThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.vptr, une valeur de type deallocator_traits<A>::void_pointer, obtenue par conversion deptrOriginal:vptr, a value of typeallocator_traits<A>::void_pointer, obtained by conversion fromptrThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.cvptr, une valeur de type deallocator_traits<A>::const_void_pointer, obtenue par conversion à partir decptrouvptrOriginal:cvptr, a value of typeallocator_traits<A>::const_void_pointer, obtained by conversion fromcptror fromvptrThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.xptr, un pointeur dereferencable une certaineXtypeOriginal:xptr, a dereferencable pointer to some typeXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
| Expression | Requirements | Return type |
|---|---|---|
A::pointer (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Satisfies NullablePointer and RandomAccessIterator
|
|
A::const_pointer (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
A::pointer is convertible to A::const_pointer. Satisfies NullablePointer and RandomAccessIterator
|
|
A::void_pointer (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
A::pointer is convertible to A::void_pointer
B::void_pointer et A::void_pointer sont du même type. NullablePointer satisfaitOriginal: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
|
A::const_void_pointer (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
A::pointer, A::const_pointer, and A::void_pointer are convertible to A::const_void_pointer
B::const_void_pointer et A::const_void_pointer sont du même type. NullablePointer satisfaitOriginal: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
|
A::value_type
|
the type T
| |
A::size_type (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
A::size_type can represent the size of the largest object A can allocate
|
unsigned integer type |
A::difference_type (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
A::difference_type can represent the difference of any two pointers to the objects allocated by A
|
signed integer type |
A::template rebind<U>::other (option [1] )
Original: optional[1] The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
for any U, B::template rebind<T>::other is A
|
the type B
|
*ptr
|
T&
| |
*cptr
|
*cptr and *ptr identify the same object
|
const T&
|
ptr->m
|
same as (*ptr).m, if (*ptr).m is well-defined
|
the type of T::m
|
cptr->m
|
same as (*cptr).m, if (*cptr).m is well-defined
|
the type of T::m
|
static_cast<A::pointer>(vptr)
|
static_cast<A::pointer>(vptr) == ptr
|
A::pointer
|
static_cast<A::const_pointer>(cvptr)
|
static_cast<A::const_pointer>(vptr) == cptr
|
A::const_pointer
|
a.allocate(n)
|
allocates storage suitable for n objects of type T, but does not construct them. May throw exceptions.
|
A::pointer
|
a.allocate(n, cptr) (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
same as a.allocate(n), but may use cptr in unspecified manner to aid locality
|
A::pointer
|
a.deallocate(ptr, n)
|
deallocates storage previously allocated by a call to a.allocate(n). Does not call destructors, if any objects were constructed, they must be destroyed before calling a.deallocate(). Does not throw exceptions.
|
(not used) |
a.max_size() (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
the largest value that can be passed to A::allocate()
|
A::size_type
|
a1 == a2
|
returns true only if the storage allocated by the allocator a1 can be deallocated through a2. Establishes reflexive, symmetric, and transitive relationship. Does not throw exceptions.
|
bool
|
a1 != a2
|
same as !(a1==a2)
|
bool
|
A a1(a)
|
Copy-constructs a1 such that a1 == a. Does not throw exceptions.
|
|
A a(b)
|
Constructs a such that B(a)==b and A(b)==a. Does not throw exceptions.
|
|
A a1(std::move(a))
|
Constructs a1 such that it equals the prior value of a. Does not throw exceptions.
|
|
A a(std::move(b))
|
Constructs a such that it equals the prior value of A(b). Does not throw exceptions.
|
|
a.construct(xptr, args) (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Constructs an object of type X in previously-allocated storage at the address pointed to by xptr, using args as the constructor arguments
|
|
a.destroy(xptr) (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Destructs an object of type X pointed to by xptr, but does not deallocate any storage.
|
|
a.select_on_container_copy_construction() (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Provides an instance of A to be used by the container that is copy-constructed from the one that uses a currently. Usually returns either a copy of a or a default-constructed A().
|
A
|
a.propagate_on_container_copy_assignment (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
true if the allocator of type A needs to be copied when the container that uses it is copy-assigned
|
std::true_type or std::false_type or derived from such |
a.propagate_on_container_move_assignment (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
true if the allocator of type A needs to be copied when the container that uses it is move-assigned
|
std::true_type or std::false_type or derived from such |
a.propagate_on_container_swap (en option )
Original: optional The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
true if the allocators of type A need to be swapped when two containers that use them are swapped
|
std::true_type or std::false_type or derived from such |
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.