C++ Ranges proposal for the Standard Library

via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 19 06:26:31 PDT 2014


On Sunday, 19 October 2014 at 11:56:10 UTC, bachmeier wrote:
> Anything that you can do with an iterator can be done with a 
> tail recursive function, but not vice versa, which means 
> iterators serve no purpose.

I guess that comment was ironic, but end-begin kind of disproves 
it :-).

I kind of like the concept of "cursors" in databases, where you 
can pin-point a position in a query result and continue even 
after the table has changed.

For a linked list it is is easy to get "cursor semantics". Not so 
easy for arrays, but it should be possible to define "cursor 
enabled containers" with appropriate locking.


More information about the Digitalmars-d mailing list