Iterator library
Материал из cppreference.com
< cpp
|
|
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. |
Итератор библиотека содержит определения для пяти видов итераторы, а также итератор черты, адаптеры и функции полезности.
Original:
The iterator library provides definitions for five kinds of iterators as well as iterator traits, adapters, and utility functions.
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.
Содержание |
[править] Iterator категорий
Есть пять видов итераторы:
InputIterator, OutputIterator, ForwardIterator, BidirectionalIterator, и RandomAccessIterator.Original:
There are five kinds of iterators:
InputIterator, OutputIterator, ForwardIterator, BidirectionalIterator, and RandomAccessIterator.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.
Вместо того, определяются конкретные виды, каждой категории итератора определяется операций, которые можно выполнять на нем. Это определение означает, что любой тип, который поддерживает необходимые операции могут быть использованы в качестве итератора - например, указатель поддерживает все операции, необходимые при
RandomAccessIterator, так что указатель может быть использован в любом месте RandomAccessIterator ожидается.Original:
Instead of being defined by specific types, each category of iterator is defined by the operations that can be performed on it. This definition means that any type that supports the necessary operations can be used as an iterator -- for example, a pointer supports all of the operations required by
RandomAccessIterator, so a pointer can be used anywhere a RandomAccessIterator is expected.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.
Пять категорий итераторов могут быть организованы в иерархии, где более мощной категории итератора (например,
RandomAccessIterator) поддерживает деятельность менее мощный категорий (например, InputIterator)Original:
The five iterator categories can be organized into a hierarchy, where more powerful iterator categories (e.g.
RandomAccessIterator) support the operations of less powerful categories (e.g. InputIterator):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.
| Iterator category | Defined operations | |||
|---|---|---|---|---|
RandomAccessIterator
|
BidirectionalIterator
|
ForwardIterator
|
InputIterator
|
|
OutputIterator
|
| |||
| ||||
| ||||
| ||||
[править] Iterator примитивов
| предоставляет единый интерфейс к свойствам итератор Original: provides uniform interface to the properties of an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| пустым типов класса используется для обозначения категорий итераторов Original: empty class types used to indicate iterator categories The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (класс) | |
| основные итератор Original: the basic iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
[править] Iterator адаптеров
| Итератор адаптер для обратного порядка обхода Original: iterator adaptor for reverse-order traversal The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| (C++11) |
Итератор адаптер, который разыменовывает в RValue ссылки Original: iterator adaptor which dereferences to an rvalue reference The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) |
| (C++11) |
создает std::move_iterator типа выводится из аргументов Original: creates a std::move_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
| Итератор адаптер для вставки в конце контейнера Original: iterator adaptor for insertion at the end of a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| создает std::back_insert_iterator типа выводится из аргументов Original: creates a std::back_insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Итератор адаптер для вставки в передней части контейнера Original: iterator adaptor for insertion at the front of a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| создает std::front_insert_iterator типа выводится из аргументов Original: creates a std::front_insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
| Итератор адаптер для вставки в контейнер Original: iterator adaptor for insertion into a container The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| создает std::insert_iterator типа выводится из аргументов Original: creates a std::insert_iterator of type inferred from the argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
[править] Поток итераторы
| итератор ввода, который читает std::basic_istream Original: input iterator that reads from std::basic_istream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| Выход итератора, который пишет std::basic_ostream Original: output iterator that writes to std::basic_ostream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| итератор ввода, который читает std::basic_streambuf Original: input iterator that reads from std::basic_streambuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
| Выход итератора, который пишет std::basic_streambuf Original: output iterator that writes to std::basic_streambuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |
[править] Iterator операций
| Определено в файле <iterator>
| |
| авансы итератор на заданное расстояние Original: advances an iterator by given distance 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 distance between two iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) | |
| (C++11) |
увеличить итератор Original: increment an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) |
| (C++11) |
уменьшаем итератор Original: decrement an iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) |
[править] Диапазон доступа
| Определено в файле <iterator>
| |
| (C++11) |
возвращает итератор на начало контейнера или массива Original: returns an iterator to the beginning of a container or array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) |
| (C++11) |
возвращает итератор на конец контейнера или массива Original: returns an iterator to the end of a container or array The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) |