"cpp/iterator"의 두 판 사이의 차이
(새 문서: {{title|Iterator library}} {{cpp/iterator/navbar}} The iterator library provides definitions for five kinds of iterators as well as iterator traits, adapters, and utility functions. ...) |
(translate to korean) |
||
2번째 줄: | 2번째 줄: | ||
{{cpp/iterator/navbar}} | {{cpp/iterator/navbar}} | ||
− | + | iterator, , . | |
===Iterator categories=== | ===Iterator categories=== | ||
− | + | : {{concept|InputIterator}}, {{concept|OutputIterator}}, {{concept|ForwardIterator}}, {{concept|BidirectionalIterator}}, {{concept|RandomAccessIterator}}. | |
− | |||
− | + | . . | |
+ | |||
+ | |||
+ | {{concept|RandomAccessIterator}})({{concept|InputIterator}}). {{concept|OutputIterator}}''mutable'' . Non-mutable ''constant'' . | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
95번째 줄: | 98번째 줄: | ||
[[de:cpp/iterator]] | [[de:cpp/iterator]] | ||
[[es:cpp/iterator]] | [[es:cpp/iterator]] | ||
+ | |||
[[fr:cpp/iterator]] | [[fr:cpp/iterator]] | ||
[[it:cpp/iterator]] | [[it:cpp/iterator]] | ||
[[ja:cpp/iterator]] | [[ja:cpp/iterator]] | ||
+ | |||
[[pt:cpp/iterator]] | [[pt:cpp/iterator]] | ||
[[ru:cpp/iterator]] | [[ru:cpp/iterator]] | ||
[[tr:cpp/iterator]] | [[tr:cpp/iterator]] | ||
[[zh:cpp/iterator]] | [[zh:cpp/iterator]] |
2013년 10월 21일 (월) 06:42 판
반복자(iterator) 라이브러리는 다섯가지 종류의 반복자 뿐만아니라 반복자 특징, 어뎁터, 유틸리티 함수를 제공합니다.
목차 |
Iterator categories
다섯가지 종류의 반복자 : InputIterator
, OutputIterator
, ForwardIterator
, BidirectionalIterator
, RandomAccessIterator
.
각 카테고리는 특정 타입에 의해 정의되는 것이 아니라 각 반복자가 어떻게 동작하느냐로 정의됩니다. 이 정의는 타입별로 필요한 동작을 수행하는 반복자를 사용할 수 있다는 것입니다. -- 예를들어, 포인터는 RandomAccessIterator
의 모든 요구사항을 지원하기 때문에 RandomAccessIterator
가 필요한 모든 곳에서 포인터가 사용될 수 있습니다.
다섯가지 중 네가지 반복자 카테고리는 계층적으로 구분할 수 있으며, 최상위 반복자(예를들어 RandomAccessIterator
)는 하위 반복자(예를들어 InputIterator
)의 기능을 포함합니다. 만약 반복자가 이 카테고리중 하나에 속하면 OutputIterator
의 요구사항을 만족해야 합니다. 그리고 이는 mutable 반복자라 부르고 입,출력을 모두 지원합니다. Non-mutable 반복자는 constant 반복자라고 부릅니다.
Iterator category | Defined operations | |||
---|---|---|---|---|
RandomAccessIterator
|
BidirectionalIterator
|
ForwardIterator
|
InputIterator
|
|
| ||||
| ||||
| ||||
Iterators that fall into one of the above categories and also meet the requirements of | ||||
OutputIterator
|
|
Iterator primitives
provides uniform interface to the properties of an iterator (class template) | |
empty class types used to indicate iterator categories (class) | |
the basic iterator (class template) |
Iterator adaptors
iterator adaptor for reverse-order traversal (class template) | |
(C++11) |
iterator adaptor which dereferences to an rvalue reference (class template) |
(C++11) |
creates a std::move_iterator of type inferred from the argument (function template) |
iterator adaptor for insertion at the end of a container (class template) | |
creates a std::back_insert_iterator of type inferred from the argument (function template) | |
iterator adaptor for insertion at the front of a container (class template) | |
creates a std::front_insert_iterator of type inferred from the argument (function template) | |
iterator adaptor for insertion into a container (class template) | |
creates a std::insert_iterator of type inferred from the argument (function template) |
Stream iterators
input iterator that reads from std::basic_istream (class template) | |
output iterator that writes to std::basic_ostream (class template) | |
input iterator that reads from std::basic_streambuf (class template) | |
output iterator that writes to std::basic_streambuf (class template) |
Iterator operations
<iterator> 헤더에 정의됨. | |
advances an iterator by given distance (function) | |
returns the distance between two iterators (function) | |
(C++11) |
increment an iterator (function) |
(C++11) |
decrement an iterator (function) |
Range access
<iterator> 헤더에 정의됨. | |
(C++11) (C++14) |
returns an iterator to the beginning of a container or array (function) |
(C++11) (C++14) |
returns an iterator to the end of a container or array (function) |
(C++14) |
returns a reverse iterator to a container or array (function) |
(C++14) |
returns a reverse end iterator for a container or array (function) |