std::set
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Заголовочный файл <set>
|
||
| template< class Key, |
||
Set это ассоциативный контейнер, который содержит упорядоченный набор уникальных объектов типа Key. Сортировка производится с помощью функциональной клавиши сравнения сравнить. Поиск, удаление и вставка операции имеют логарифмическую сложность. Наборы обычно реализуется как красно-черные деревья.
Original:
Set is an associative container that contains a sorted set of unique objects of type Key. Sorting is done using the key comparison function Compare. Search, removal, and insertion operations have logarithmic complexity. Sets are usually implemented as красно-черные деревья.
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.
std::set отвечает требованиям Container, AllocatorAwareContainer, AssociativeContainer и ReversibleContainer.Original:
std::set meets the requirements of Container, AllocatorAwareContainer, AssociativeContainer 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.
[править] Член типов
| Член типа
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 |
key_type
|
Key
|
value_type
|
Key
|
size_type
|
Беззнаковый целочисленный тип (обычно size_t) |
difference_type
|
Знаковый целочисленный тип (обычно std::ptrdiff_t) |
key_compare
|
Compare
|
value_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 (до C++11)Constant bidirectional iterator (начиная с C++11) |
const_iterator
|
Константный двусторонний итератор |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[править] Член функций
| строит set Original: constructs the set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public функция-член) | |
destructs the set (public функция-член) | |
| присваивает значения в контейнере 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. (public функция-член) | |
| возвращает связанный распределителя 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. (public функция-член) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| возвращает итератор на первый элемент (public функция-член) | |
| возвращает итератор на элемент, следующий за последним (public функция-член) | |
| возвращает обратный итератор на начало 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. (public функция-член) | |
| возвращает обратный итератор до конца 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. (public функция-член) | |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| проверяет отсутствие элементов в контейнере (public функция-член) | |
| возвращает количество элементов 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. (public функция-член) | |
| возвращает максимально допустимое количество элементов (public функция-член) | |
Original: Modifiers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| удаляет содержимое (public функция-член) | |
| вставки элементов 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. (public функция-член) | |
| (C++11) |
конструирует элемент "на месте" (public функция-член) |
| (C++11) |
Элементы конструкций на месте использования подсказки 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. (public функция-член) |
| удаляет элементы 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. (public функция-член) | |
| обмениевает содержимое (public функция-член) | |
Original: Lookup The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| возвращает количество элементов, соответствующих определенным ключом 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. (public функция-член) | |
| находит элемент с конкретным ключом 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. (public функция-член) | |
| возвращает набор элементов для конкретного ключа 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. (public функция-член) | |
| возвращает итератор на первый элемент' не менее, чем заданное значение 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. (public функция-член) | |
| возвращает итератор на первый элемент' больше, чем определенное значение 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. (public функция-член) | |
Original: Observers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| возвращает функцию, сравнивающую ключи (public функция-член) | |
| возвращает функцию, сравнивающую значения (public функция-член) | |
[править] Не являющиеся членами функций
| лексикографически сравнивает значения в set Original: lexicographically compares the values in the set The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Специализируется 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. (шаблон функции) | |