Used in a Sentence

iterator

Definitions, parts of speech, synonyms, and sentence examples for iterator.

Editorial note

Either an index is incremented/decremented, or an iterator object's next() comes in.

Examples16
Definitions2
Parts of speech1

Quick take

One who or that which iterates.

Meaning at a glance

The clearest senses and uses of iterator gathered in one view.

noun

One who or that which iterates.

noun

(programming) A method capable of performing the same action on every item in a collection.

Definitions

Core meanings and parts of speech for iterator.

noun

One who or that which iterates.

noun

(programming) A method capable of performing the same action on every item in a collection.

Example sentences

1

Either an index is incremented/decremented, or an iterator object's next() comes in.

2

Thinking they're hard or hold the secrets of the universe is like thinking the Iterator interface is hard or holds the secrets of the universe.

3

Compare that to: Iterator find(T& value) const; This function signature accepts only non-const references (unless T is const).

4

It is _much_ faster than a similar container[2] implemented using AVL trees, but at the cost of iterator stability.

5

Before, if you looked at all of an objects' properties in SpiderMonkey, you will have noticed an `@@iterator` property.

6

You can sort of use bitfields with ragel if you fashion a bit iterator in C++.

7

They then added stream() and parallelStream() default methods to the Collection interface to generate streams and start all of the iterator goodness.

8

Might as well just provide an iterator over graphemes in the first place.

9

Mapping an object to its iterator is going to be part of the spec and will be required at the language level (`for...of`).

10

Did I have to teach you the Iterator protocol in order to understand that?

11

Specifically in JavaScript (some are already available in ES6): Proxy, Symbol (especially Symbol.iterator), computed property names, destructuring, and splats...

12

It makes working with iterators easy - this way you're always talking about one thing at a time, instead of the whole collection/iterator, making efficient computation easy.

Quote examples

1

Since there are side effects that can affect either the iterator or the index, and dependent side effects between loop body runs, obeying a "for" loop means strictly ordered (unless the iterator interface abstracts something else), serialized execution of the loop body.

2

You can just swap the order your variables in whatever struct defines your node and cast it against your existing memory (or change what your accessors return in a derived class or create a reverse iterator or however you want to implement it) and there you go, a "reversed" tree with zero overhead.

Proper noun examples

1

The one language-specific thing was about Java iterators, so I had to ask about the Iterable/Iterator contract before I could start.

2

The easiest way to achieve this is to call a helper function and pass a tag object whose type is iterator_traits<Iterator>::iterator_category, which might be forward_iterator_tag or random_access_iterator_tag.

Frequently asked questions

Short answers drawn from the clearest meanings and examples for this word.

How do you use iterator in a sentence?

Either an index is incremented/decremented, or an iterator object's next() comes in.

What does iterator mean?

One who or that which iterates.

What part of speech is iterator?

iterator is commonly used as noun.