Is there an efficient way to know how many elements are in an iterator in Python, in general, without iterating through each and counting? 19 Answers 19
I wonder why cbegin and cend were introduced in C++11? What are cases when calling these methods makes a difference from const overloads of begin and end? 7 Answers...
Why does the Standard define end() as one past the end, instead of at the actual end? 7 Answers 7
Every standard container has a begin and end method for returning iterators for that container. However, C++11 has apparently introduced free functions called std::begin and std::end which call the...
Haven’t Python iterators got a has_next method? 17 Answers 17
I’m trying to iterate over a typescript map but I keep getting errors and I could not find any solution yet for such a trivial problem. My code is:...
So, I wrote a bunch of code that accesses elements in an stl vector by index, but now I need to copy just a chunk of the vector. It...
I am new in Java and I’m really confused with iterator and iterable. Can anyone explain to me and give some examples? 14 Answers 14
I am new to the C++ language. I have been starting to use vectors, and have noticed that in all of the code I see to iterate though a...
I want to have a reversed list view on a list (in a similar way than List#sublist provides a sublist view on a list). Is there some function which...