Namespace
Varianti

std::vector

Da cppreference.com.
< cpp‎ | container


 
 
 
std::vector
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::vector
vector::~vector
vector::operator=
vector::assign
vector::get_allocator
Elemento accesso
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.
vector::at
vector::operator[]
vector::front
vector::back
vector::data(C++11)
Iteratori
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::begin
vector::cbegin

(C++11)
vector::end
vector::cend

(C++11)
vector::rbegin
vector::crbegin

(C++11)
vector::rend
vector::crend

(C++11)
Capacità
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::empty
vector::size
vector::max_size
vector::reserve
vector::capacity
vector::shrink_to_fit(C++11)
Modificatori
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vector::clear
vector::insert
vector::emplace(C++11)
vector::erase
vector::push_back
vector::emplace_back(C++11)
vector::pop_back
vector::resize
vector::swap
 
Defined in header <vector>
template<

    class T,
    class Allocator = std::allocator<T>

> class vector;
std::vector sequenza è un contenitore che racchiude in sé gli array dinamici dimensioni.
Original:
std::vector is a sequence container that encapsulates dynamic size arrays.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Gli elementi sono memorizzati in modo contiguo, il che significa che gli elementi non si può accedere solo attraverso iteratori, ma anche utilizzando offset su puntatori regolari elementi. Ciò significa che un puntatore ad un elemento di un vettore può essere passato a qualsiasi funzione che prevede un puntatore a un elemento di un array.
Original:
The elements are stored contiguously, which means that elements can be accessed not only through iterators, but also using offsets on regular pointers to elements. This means that a pointer to an element of a vector may be passed to any function that expects a pointer to an element of an array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La memorizzazione del vettore viene gestita automaticamente, in fase di espansione e contrazione come necessario. Vettori di solito occupano più spazio di array statici, perché allocare più memoria per gestire la crescita futura. In questo modo un vettore non ha bisogno di riassegnare ogni volta che viene inserito un elemento, ma solo quando la memoria aggiuntiva è esaurita. La quantità totale di memoria allocata può essere interrogato con la funzione capacity(). Memoria supplementare può essere restituito al sistema tramite una chiamata a shrink_to_fit().
Original:
The storage of the vector is handled automatically, being expanded and contracted as needed. Vectors usually occupy more space than static arrays, because more memory is allocated to handle future growth. This way a vector does not need to reallocate each time an element is inserted, but only when the additional memory is exhausted. The total amount of allocated memory can be queried using capacity() function. Extra memory can be returned to the system via a call to shrink_to_fit().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Riassegnazioni di solito sono operazioni costose in termini di prestazioni. reserve() funzione può essere utilizzata per eliminare riassegnazioni se il numero di elementi è noto in anticipo.
Original:
Reallocations are usually costly operations in terms of performance. reserve() function can be used to eliminate reallocations if the number of elements is known beforehand.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La complessità (efficienza) di operazioni comuni sui vettori è il seguente:
Original:
The complexity (efficiency) of common operations on vectors 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.
  • Accesso casuale - O(1) costante
    Original:
    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 - ammortizzato O(1) costante
    Original:
    Insertion or removal of elements at the end - 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.
  • Inserimento o la rimozione di elementi - lineare distanza dalla fine della O(n) vettore
    Original:
    Insertion or removal of elements - linear in distance to the end of the vector 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::vector soddisfi i requisiti di Container, AllocatorAwareContainer, SequenceContainer e ReversibleContainer.
Original:
std::vector 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.

Indice

[modifica] Specializzazioni

La libreria standard fornisce una specializzazione per il std::vector bool tipo, che è ottimizzato per l'efficienza dello spazio.
Original:
The standard library provides a specialization of std::vector for the type bool, which is optimized for space efficiency.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
spazio-efficiente bitset dinamica
Original:
space-efficient dynamic bitset
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe template) [edit]

[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 [edit]
allocator_type Allocator [edit]
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.
[edit]
difference_type Signed integer type (usually ptrdiff_t) [edit]
reference Allocator::reference (C fino + 11)
value_type& (dal C++11) [edit]
const_reference Allocator::const_reference (C fino + 11)
const value_type& (dal C++11) [edit]
pointer Allocator::pointer (C fino + 11)
std::allocator_traits<Allocator>::pointer (dal C++11) [edit]
const_pointer Allocator::const_pointer (C fino + 11)
std::allocator_traits<Allocator>::const_pointer (dal C++11) [edit]
iterator RandomAccessIterator [edit]
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.
[edit]
reverse_iterator std::reverse_iterator<iterator> [edit]
const_reverse_iterator std::reverse_iterator<const_iterator> [edit]

[modifica] Membri funzioni

costruisce il vector
Original:
constructs the vector
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) [edit]
destructs the vector
(membro pubblico funzione) [edit]
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) [edit]
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) [edit]
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) [edit]
Elemento accesso
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) [edit]
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) [edit]
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) [edit]
access the last element
(membro pubblico funzione) [edit]
(C++11)
accesso diretto alla matrice sottostante
Original:
direct access to the underlying array
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) [edit]
Iteratori
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) [edit]
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) [edit]
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) [edit]
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) [edit]
Capacità
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) [edit]
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) [edit]
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) [edit]
riserve di stoccaggio
Original:
reserves storage
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) [edit]
restituisce il numero di elementi che possono essere tenuti in deposito attualmente assegnate
Original:
returns the number of elements that can be held in currently allocated storage
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) [edit]
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) [edit]
Modificatori
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) [edit]
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) [edit]
(C++11)
constructs element in-place
(membro pubblico funzione) [edit]
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) [edit]
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) [edit]
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) [edit]
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) [edit]
changes the number of elements stored
(membro pubblico funzione) [edit]
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) [edit]

[modifica] Non membri funzioni

lessicografico confronta i valori nella vector
Original:
lexicographically compares the values in the vector
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) [edit]
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) [edit]