|
|
|
|
rapidcoder wrote: |
---|
I'm still curious where this C++ programmers love for iterators is coming from. |
no offense but they're yucky. |
return type in front, where it belongs |
Iterators are great |
I believe it comes from the fact that Iterators allow Containers and Algorithms to be combined like Lego. *tongue-in-cheek* |
Some algorithms require several passes over data or random access, and then iterator concept does not fit naturally. |
And it breaks totally for parallel algorithms |
rabidcoder wrote: |
---|
And it breaks totally for parallel algorithms (but this is not a problem, as long as the standard library does not offer anything here) |
CatFish wrote: |
---|
Also if you write auto then why do you need to later write std::pair<Iter,Iter> as well? |
|
|
Lachlan Easton wrote: |
---|
I'm having trouble seeing how o_O |
|
|
Lachlan Easton wrote: |
---|
That's less a limitation of iterators than it is a limitation of lists. |
myesolar wrote: |
---|
Putting it on the right hand side puts it in scope of the function. |
|
|
Breaking news, a single design pattern isn't a one size fits all. |
rapidcoder wrote: |
---|
C++ used this single pattern as the main design pattern of all the container library, forcing every concept that is not really an iterator be iterator. |
|
|
True. And C++ used this single pattern as the main design pattern of all the container library, forcing every concept that is not really an iterator be iterator. |
Who told you I hate C++ more than I hate Java? |
This is C++ forum so we're discussing ugly code in C++ |