Skip to content

Commit ae7ab66

Browse files
TylerMSFTTylerMSFT
authored andcommitted
add diagrams and crosslink iterator concepts to definitions
1 parent 23b7ced commit ae7ab66

12 files changed

+364
-12
lines changed

docs/standard-library/drop-while-view-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For a description of the following entries, see [View class characteristics](vie
3636
| Characteristic | Description |
3737
|--|--|
3838
| **Range adaptor** | [`views::drop_while`](range-adaptors.md#drop_while) |
39-
| **Underlying range** | Must satisfy [`forward_range`](range-concepts.md#forward_range) or higher and the underlying range's iterators must model `sized_sentinel_for` |
39+
| **Underlying range** | Must satisfy [`forward_range`](range-concepts.md#forward_range) or higher and the underlying range's iterators must model [`sized_sentinel_for`](iterator-concepts.md#sized_sentinel_for) |
4040
| **Element type** | Same as the underlying range |
4141
| **View iterator category** | Same as the underlying range |
4242
| **Sized** | Only if the underlying range satisfies [`random_access_range`](range-concepts.md#random_access_range) |

docs/standard-library/iterator-concepts.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ There are six categories of iterators. They're directly related to the categorie
5656

5757
The following iterator concepts are listed in order of increasing capability. `input_or_output_iterator` is at the low end of the capability hierarchy, and `contiguous_iterator` is at the high end. Iterators higher in the hierarchy can generally be used in place of those that are lower, but not vice-versa. For example, a `random_access_iterator` iterator can be used in place of a `forward_iterator`, but not the other way around. An exception is `input_iterator`, which can't be used in place of `output_iterator` because it can't write.
5858

59+
:::image type="content" source="media/iterator-hierarchy.svg" alt-text="Diagram of the iterator hierarchy. input_or_output_iterator is the base. input_iterator and output_iterator are shown as refining input_or_output_iterator. forward_iterator is next and refines both input_iterator and output_iterator. bidirectional_iterator refines forward_iterator. random_access_iterator refines bidirectional_iterator. Finally, contiguous_iterator refines random_access_iterator":::
60+
5961
In the following table, "Multi-pass" refers to whether the iterator can revisit the same element more than once. For example, `vector::iterator` is a multi-pass iterator because you can make a copy of the iterator, read the elements in the collection, and then restore the iterator to the value in the copy, and revisit the same elements again. If an iterator is single-pass, you can only visit the elements in the collection once.
6062

6163
In the following table, "Types" refers to the types of collections/iterators that satisfy the concept.
@@ -477,5 +479,6 @@ int main()
477479

478480
## See also
479481

482+
[Range concepts](range-concepts.md)\
480483
[Range adaptors](range-adaptors.md)\
481484
[View classes](view-classes.md)
Lines changed: 194 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)