Пространства имён
Варианты
Действия

std::multimap

Материал из cppreference.com
Версия от 20:20, 13 мая 2012; 137.71.23.54 (обсуждение) (Новая страница: «{{cpp/title|multimap}} {{cpp/container/multimap/sidebar}} {{ddcl | header=map | template< class Key, class T, class Compare {{=}} std::less<Key>, …»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)
 
 
 
 
<tbody> </tbody>
Определено в заголовочном файле <map>
template< class Key, class T, class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> > > class multimap;

Multimap - это ассоциативный контейнер, который содержит сортированный список пар ключ-значение. Сортировка производится функцией сравнения Compare применительно к ключам. Поиск, вставка и удаление имеют логарифмическую сложность.

Порядок пар ключ-значение, чьи ключи при сравнении оказываются одинаковыми, совпадает с порядком их вставки и не изменяется. (начиная с C++11)

std::multimap соответствует требованиям Container, AllocatorAwareContainer, AssociativeContainer и ReversibleContainer.

Member types

Member type Definition
key_type Key [править]
mapped_type T [править]
value_type std::pair<const Key, T> [править]
size_type Unsigned integral type (usually size_t) [править]
difference_type Signed integer type (usually ptrdiff_t) [править]
key_compare Compare [править]
allocator_type Allocator [править]
reference Allocator::reference (до C++11)
value_type& (начиная с C++11) [править]
const_reference Allocator::const_reference (до C++11)
const value_type& (начиная с C++11) [править]
pointer Allocator::pointer (до C++11)
std::allocator_traits<Allocator>::pointer (начиная с C++11) [править]
const_pointer Allocator::const_pointer (до C++11)
std::allocator_traits<Allocator>::const_pointer (начиная с C++11) [править]
iterator BidirectionalIterator [править]
const_iterator Constant bidirectional iterator [править]
reverse_iterator std::reverse_iterator<iterator> [править]
const_reverse_iterator std::reverse_iterator<const_iterator> [править]

Member classes

Шаблон:cpp/container/dcl list value compare

Методы (фунции-члены)

Шаблон:cpp/container/dcl list constructorШаблон:cpp/container/dcl list destructorШаблон:cpp/container/dcl list operator=Шаблон:cpp/container/dcl list get allocatorШаблон:cpp/container/dcl list beginШаблон:cpp/container/dcl list endШаблон:cpp/container/dcl list rbeginШаблон:cpp/container/dcl list rendШаблон:cpp/container/dcl list emptyШаблон:cpp/container/dcl list sizeШаблон:cpp/container/dcl list max sizeШаблон:cpp/container/dcl list clearШаблон:cpp/container/dcl list insertШаблон:cpp/container/dcl list emplaceШаблон:cpp/container/dcl list emplace hintШаблон:cpp/container/dcl list eraseШаблон:cpp/container/dcl list swapШаблон:cpp/container/dcl list countШаблон:cpp/container/dcl list findШаблон:cpp/container/dcl list equal rangeШаблон:cpp/container/dcl list lower boundШаблон:cpp/container/dcl list upper boundШаблон:cpp/container/dcl list key compШаблон:cpp/container/dcl list value comp
Итераторы
Емкость
Модификаторы
Поиск
Observers

Функции не члены

Шаблон:cpp/container/dcl list operator cmpШаблон:cpp/container/dcl list swap2