Are there support for iterator adaptors and consumers in the standard library?

I don’t know if anybody has done this, but it would be nice to have a place where common names for things are collected. For example: is the method to create an iterator instance generally called first(), iter(), iterator() or something else?

Yes the language doesn’t care, but when we read code it helps to have consistent names for things.

3 Likes

Correct! It was added to illustrate a feature which supports iteration.

Zig style would prefer iterator() from what I’ve seen. Might call the return value iter though.

2 Likes