std::multiset
Definido no cabeçalho <set> | ||
template< class Key, | ||
std::multiset
é um contêiner associativo que contém um conjunto ordenado de objetos do tipo Key. Diferentemente do set, são permitidas múltiplas chaves com valores equivalentes. A ordenação é feita usando a função de comparação de chaves Compare. As operações de pesquisar, inserir, e remover têm complexidade logarítmica.
Onde a biblioteca padrão usa os requerimentos de Compare, a equivalência é determinada usando a relação de equivalência descrita em Compare. Em termos inexatos, dois objetos a
e b
são considerados equivalentes se nenhum dos dois compara menor do que o outro: !comp(a, b) && !comp(b, a)
.
A ordem dos elementos que comparam equivalentemente é a ordem de inserção, que não muda. (desde C++11)
std::multiset
cumpre os requisitos de Container, AllocatorAwareContainer, AssociativeContainer e ReversibleContainer.
Índice |
[editar]Tipos de membro
Tipo de membro | Definição |
key_type | Key |
value_type | Key |
size_type | Tipo integral sem sinal (geralmente 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 | tipo inteiro com sinal (geralmente ptrdiff_t) Original: Signed integer type (usually The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
key_compare | Compare |
value_compare | Compare |
allocator_type | Allocator |
reference | Allocator::reference (até C++11)value_type& (desde C++11) |
const_reference | Allocator::const_reference (até C++11)const value_type& (desde C++11) |
pointer | Allocator::pointer (até C++11)std::allocator_traits<Allocator>::pointer(desde C++11) |
const_pointer | Allocator::const_pointer(até C++11) std::allocator_traits<Allocator>::const_pointer(desde C++11) |
iterator | BidirectionalIterator (até C++11) iterador (desde C++11)Constant bidirecional Original: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
const_iterator | Iterador bidirecional constante Original: Constant bidirectional 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> |
[editar]Funções membro
constrói o multiset Original: constructs the multiset The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
destrói o multiset Original: destructs the multiset The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
atribui valores para o recipiente 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. (função pública membro) | |
retorna o alocador de associado 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. (função pública membro) | |
Iteradores | |
retorna um iterador para o começo 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. (função pública membro) | |
retorna um iterador para o fim 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. (função pública membro) | |
retorna um iterador inverso ao início 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. (função pública membro) | |
retorna um iterador inverso até ao fim 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. (função pública membro) | |
Capacidade | |
verifica se o recipiente estiver vazio 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. (função pública membro) | |
devolve o número de elementos 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. (função pública membro) | |
retorna o número máximo possível de elementos 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. (função pública membro) | |
Modificadores | |
apaga o conteúdo 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. (função pública membro) | |
insere elementos 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. (função pública membro) | |
(C++11) | constructs element in-place (função pública membro) |
(C++11) | constrói elementos no local usando uma dica Original: constructs elements in-place using a hint The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |
apaga elementos 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. (função pública membro) | |
Trocar o conteúdo 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. (função pública membro) | |
Pesquisa | |
devolve o número de elementos correspondentes chave específica Original: returns the number of elements matching specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
encontra elemento com chave específica Original: finds element with specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna a escala de elementos que combinam com uma tecla específica Original: returns range of elements matching a specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna um iterador para o primeiro elemento não menos do que o valor dado Original: returns an iterator to the first element not less than the given value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna um iterador para o primeiro elemento' maior do que um determinado valor Original: returns an iterator to the first element greater than a certain value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
Observadores | |
retorna a função que compara chaves Original: returns the function that compares keys The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |
retorna a função que compara chaves em objetos de value_type tipo Original: returns the function that compares keys in objects of type value_type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |
[editar]Funções não-membro
lexicographically compara os valores na multiset Original: lexicographically compares the values in the multiset The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) | |
o algoritmo especializado 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. (modelo de função) |