News for hackers. Stuff that matters.
Re:Writing a custom iterator in modern C++ by millstone on Sunday December 20, 2020 @11:19PM (#25492096)
I think you are arguing that iterators are "primarily" for iteration. But in C++ they really are like an abstraction over C pointers. For example, you can hold a std::list::iterator, and use it to efficiently delete from a linked list, without ever iterating.

Sometimes C pointers are used for iteration, but I would not say that is their primary purpose.

Re:Writing a custom iterator in modern C++ by jhayward on Monday December 21, 2020 @11:00AM (#25496053)
> I think you are arguing that iterators are "primarily" for iteration

I really wonder why people put up with something named this way then. "That fool thinks iterators are for iteration!"

Clarity of abstraction and good naming are important, unless the practitioners are masochists.

Re:Writing a custom iterator in modern C++ by gpderetta on Tuesday December 22, 2020 @09:08AM (#25506377)
Cursor would be a better name probably, but I wouldn't say the name is misleading, as iteration is an important use case.