Skip to content

Commit

Permalink
Add a basic cursor vs iterator paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixep committed Oct 1, 2022
1 parent cf71002 commit 91d9709
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions proposals/p1885.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ The original `for` proposal does not define a way for user-defined types to
opt-in to support range-based for loops. An approach is proposed in this
document.

This can be achieved using either a cursor or an iterator. A cursor benefits
from being simple to manipulate and understand, and is used against a container.
On the other hand, an iterators benefits from being more self-contained
(dereferencing, next item, and optionally boundary), at the expense of its
complexity.

### Other languages

This section highlights some examples of how iterators and range-based for
Expand Down

0 comments on commit 91d9709

Please sign in to comment.