std::deque
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. |
| Defined in header <deque>
|
||
| template< class T, |
||
std::deque (double-ended queue) è un contenitore di sequenza indicizzato che consente l'inserimento e la cancellazione veloce sia l'inizio e la fine. Inoltre, non inserimento e cancellazione alle due estremità di una deque invalida puntatori o riferimenti al resto degli elementi.Original:
std::deque (double-ended queue) is an indexed sequence container that allows fast insertion and deletion at both the beginning and the end. In addition, insertion and deletion at either end of a deque never invalidates pointers or references to the rest of the elements.The text has been machine-translated via Google Translate.
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.
A differenza std::vector, gli elementi di una deque non vengono memorizzati in modo contiguo: implementazioni tipiche utilizzare una sequenza di individualmente assegnate dimensione fissa array.
Original:
As opposed to std::vector, the elements of a deque are not stored contiguously: typical implementations use a sequence of individually allocated fixed-size arrays.
The text has been machine-translated via Google Translate.
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.
Lo stoccaggio del deque viene automaticamente espanso e contratto in base alle esigenze. Espansione di una deque è più conveniente che l'espansione di un std::vector perché non comporta la copia degli elementi esistenti in una nuova posizione di memoria.
Original:
The storage of the deque is automatically expanded and contracted as needed. Expansion of a deque is cheaper than the expansion of a std::vector because it does not involve copying of the existing elements to a new memory location.
The text has been machine-translated via Google Translate.
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.
La complessità (efficienza) delle operazioni comuni su deque è la seguente:
Original:
The complexity (efficiency) of common operations on deques is as follows:
The text has been machine-translated via Google Translate.
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.
- Accesso casuale - O(1) costanteOriginal:Random access - constant O(1)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - L'inserimento o la rimozione di elementi, alla fine o all'inizio - ammortizzato O(1) costanteOriginal:Insertion or removal of elements at the end or beginning - amortized constant O(1)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - L'inserimento o la rimozione di elementi - O(n) lineareOriginal:Insertion or removal of elements - linear O(n)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::deque soddisfi i requisiti di Container, AllocatorAwareContainer, SequenceContainer e ReversibleContainer.Original:
std::deque meets the requirements of Container, AllocatorAwareContainer, SequenceContainer and ReversibleContainer.The text has been machine-translated via Google Translate.
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.
[modifica] Membri tipi
| Membro tipo
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
T
|
allocator_type
|
Allocator
|
size_type
|
Unsigned tipo integrale (di solito size_t)
Original: Unsigned integral type (usually size_t) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
difference_type
|
Signed integer type (usually ptrdiff_t) |
reference
|
Allocator::reference (C fino + 11)value_type& (dal C++11)
|
const_reference
|
Allocator::const_reference (C fino + 11)const value_type& (dal C++11)
|
pointer
|
Allocator::pointer (C fino + 11)std::allocator_traits<Allocator>::pointer (dal C++11) |
const_pointer
|
Allocator::const_pointer (C fino + 11) std::allocator_traits<Allocator>::const_pointer (dal C++11) |
iterator
|
RandomAccessIterator
|
const_iterator
|
Costante iteratore ad accesso casuale
Original: Constant random access iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[modifica] Membri funzioni
| costruisce il deque Original: constructs the deque The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
destructs the deque (membro pubblico funzione) | |
| assegna valori al contenitore Original: assigns values to the container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| assegna valori al contenitore Original: assigns values to the container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce l'allocatore associato Original: returns the associated allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
Original: Element access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| accedere elemento specificato con verifica dei limiti Original: access specified element with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| accedere elemento specificato Original: access specified element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| accedere al primo elemento Original: access the first element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| access the last element (membro pubblico funzione) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| restituisce un iteratore all'inizio Original: returns an iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce un iteratore fino alla fine Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce un iteratore inverso all'inizio Original: returns a reverse iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce un iteratore inverso alla fine Original: returns a reverse iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| verifica se il contenitore è vuoto Original: checks whether the container is empty The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce il numero di elementi Original: returns the number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| restituisce il massimo numero possibile di elementi Original: returns the maximum possible number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| (C++11) |
riduce l'utilizzo della memoria da liberare la memoria inutilizzata Original: reduces memory usage by freeing unused memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| cancella il contenuto Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| inserti di elementi Original: inserts elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| (C++11) |
constructs element in-place (membro pubblico funzione) |
| cancella elementi Original: erases elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| aggiunge elementi alla fine Original: adds elements to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| (C++11) |
costruisce elementi in-posto alla fine Original: constructs elements in-place at the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) |
| rimuove l'ultimo elemento Original: removes the last element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| inserisce elementi all'inizio Original: inserts elements to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| (C++11) |
costruisce elementi in posto all'inizio Original: constructs elements in-place at the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) |
| rimuove il primo elemento Original: removes the first element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
| changes the number of elements stored (membro pubblico funzione) | |
| swap il contenuto Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |
[modifica] Non membri funzioni
| lessicografico confronta i valori nella deque Original: lexicographically compares the values in the deque The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) | |
| specializzata l'algoritmo std::swap Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) | |