std::allocator - cppreference.com
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>
| Elemento definito nell'header <memory> |
||
|
|
(1) | |
|
|
(2) | |
Il modello di classe std::allocator è il Allocator predefinita utilizzata da tutti i contenitori della libreria standard se non specificato dall'utente allocatore è fornito. L'allocatore di default è senza stato, vale a dire, tutte le istanze del allocatore dato sono intercambiabili, risultano uguali e può rilasciare la memoria allocata da qualsiasi altra istanza del tipo di allocatore stesso.
Original:
The std::allocator class template is the default Allocator used by all standard library containers if no user-specified allocator is provided. The default allocator is stateless, that is, all instances of the given allocator are interchangeable, compare equal and can deallocate memory allocated by any other instance of the same allocator type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Specializzazione per void mancano le typedef membri reference, const_reference, size_type e difference_type. Questa specializzazione dichiara non funzioni membro.
Original:
Specialization for void lacks the member typedefs reference, const_reference, size_type and difference_type. This specialization declares no member functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
| All custom allocators also must be stateless. | (fino al c++11) |
| Custom allocators may contain state. Each container or another allocator-aware object stores an instance of the supplied allocator and controls allocator replacement through std::allocator_traits. | (dal C++11) |
Membri tipi
Tipo Original: Type The text has been machine-translated via Google Translate. |
Definition |
value_type
|
T
|
pointer
|
T*
|
const_pointer
|
const T*
|
reference
|
T&
|
const_reference
|
const T&
|
size_type
|
std::size_t |
difference_type
|
std::ptrdiff_t |
rebind
|
template< class U > struct rebind { typedef allocator<U> other; };
|
Membri funzioni
crea una nuova istanza allocatore Original: creates a new allocator instance The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
distrugge un'istanza allocatore Original: destructs an allocator instance The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
ottiene l'indirizzo di un oggetto, anche se Original: obtains the address of an object, even if The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
alloca memoria non inizializzata Original: allocates uninitialized storage The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
dealloca stoccaggio Original: deallocates storage The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
restituisce la dimensione massima supportata di allocazione Original: returns the largest supported allocation size The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
costruisce un oggetto nella memoria allocata Original: constructs an object in allocated storage The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
distrugge un oggetto nella memoria allocata Original: destructs an object in allocated storage The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
Non membri funzioni
Confronta due istanze allocatore Original: compares two allocator instances The text has been machine-translated via Google Translate. (metodo pubblico) [modifica] | |
Vedi anche
(C++11) |
fornisce informazioni sui tipi di allocatore Original: provides information about allocator types The text has been machine-translated via Google Translate. (classe template) [modifica] |
(C++11) |
implementa multilivello allocatore per contenitori multi-livello Original: implements multi-level allocator for multi-level containers The text has been machine-translated via Google Translate. (classe template) [modifica] |
(C++11) |
controlla se il tipo specificato supporta usi-allocatore di costruzione Original: checks if the specified type supports uses-allocator construction The text has been machine-translated via Google Translate. (classe template) [modifica] |