Top "Iterator" questions

An iterator is an object-oriented programming pattern that allows traversal through a collection, agnostic of the actual implementation or object addresses in physical memory.

How to do for in TObjectList?

I am trying to use for in to iterate a TObjectList: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, …

delphi for-loop iterator for-in-loop listiterator
what's the point of having both Iterator.forEachRemaining() and Iterable.forEach()?

and both of them get a Consumer as parameter. so if Java 8, is meant to avoid confusions, like it has …

java foreach iterator iterable
Are const_iterators faster?

Our coding guidelines prefer const_iterator, because they are a little faster compared to a normal iterator. It seems like …

c++ stl iterator const-iterator
Looping on C++ iterators starting with second (or nth) item

I am looking for a readable, elegant way to do the following in C++, here shown in Python: for datum …

c++ coding-style iterator readability
Can I implement yield return for IEnumerable functions in VB.NET?

Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an IEnumerble<>, you can …

vb.net ienumerable iterator yield-return
Why is "!=" used with iterators instead of "<"?

I'm used to writing loops like this: for (std::size_t index = 0; index < foo.size(); index++) { // Do stuff with …

c++ stl iterator comparison-operators
Pair-wise iteration in C# or sliding window enumerator

If I have an IEnumerable like: string[] items = new string[] { "a", "b", "c", "d" }; I would like to loop thru …

c# .net iterator ienumerable
Why use rbegin() instead of end() - 1?

I'm wondering what the benefits of using rbegin() rather than end() - 1 are for STL containers. For example, why would …

c++ vector stl iterator reverse-iterator
Does PHP Have a "built-in" iterator in a Foreach loop?

I'm using a foreach loop to go through the REQUEST array, as I want to have an easy way to …

php foreach iterator phpexcel
How to iterate over a SortedSet to modify items within

lets say I have an List. There is no problem to modify list's item in for loop: for (int i = 0; …

java iterator sortedset