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.

iterating over each character of a String in ruby 1.8.6 (each_char)

I am new to ruby and currently trying to operate on each character separately from a base String in ruby. …

ruby string iterator
Deleting elements from std::set while iterating

I need to go through a set and remove elements that meet a predefined criteria. This is the test code …

c++ iterator set std c++-standard-library
Creating my own Iterators

I'm trying to learn C++ so forgive me if this question demonstrates a lack of basic knowledge, you see, the …

c++ iterator
How to increment an iterator by 2?

Can anybody tell me how to increment the iterator by 2? iter++ is available - do I have to do iter+2? …

c++ visual-c++ stl iterator
Can iterators be reset in Python?

Can I reset an iterator / generator in Python? I am using DictReader and would like to reset it to the …

python iterator generator
What is the difference between const_iterator and non-const iterator in the C++ STL?

What is the difference between a const_iterator and an iterator and where would you use one over the other?

c++ stl iterator constants
Python range() and zip() object type

I understand how functions like range() and zip() can be used in a for loop. However I expected range() to …

python python-3.x list iterator range
Why does next raise a 'StopIteration', but 'for' do a normal return?

In this piece of code, why does using for result in no StopIteration or is the for loop trapping all …

python iterator generator stopiteration
Difference between Java Enumeration and Iterator

What is the exact difference between these two interfaces? Does Enumeration have benefits over using Iterator? If anyone could elaborate, …

java collections iterator enumeration
Java Iterator backed by a ResultSet

I've got a class that implements Iterator with a ResultSet as a data member. Essentially the class looks like this: …

java sql jdbc iterator resultset