close
Espaços nominais
Variantes
Ações

deduction guides for std::vector

De cppreference.com
 
 
 
std::vector
Funções de membro
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
acesso. Elemento
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)
Iteradores
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)
Capacidade
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)
Modificadores
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
 
<tbody> </tbody>
Definido no cabeçalho <vector>
template< class InputIt, class Alloc = std::allocator<typename std::iterator_traits<InputIt>::value_type>> vector(InputIt, InputIt, Alloc = Alloc()) -> vector<typename std::iterator_traits<InputIt>::value_type, Alloc>;
Este deduction guide é provido vector para permitir dedução de um intervalo de iterador. Predefinição:cpp/enable if.
Original:
This deduction guide is provided for vector to allow deduction from an iterator range. Predefinição:cpp/enable if.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Predefinição:cpp/container/inputit allocator detection

Exemplo

#include <vector>

int main() {
   std::vector<int> v = {1, 2, 3, 4};

   // usa dedução explícita para deduzir std::vector<int>
   std::vector x(v.begin(), v.end()); 

   // dedus std::vector<std::vector<int>::iterator>
   // primeira fase da da resolução de sobrecarga para list-inicialization seleciona o candidato
   // sintetizado do construtor de initializer-list; segunda fase não é realizada
   // o guia de dedução não tem efeito
   std::vector y{v.begin(), v.end()}; 
}