Array focused iterators

rkompass rkompass at gmx.de
Sat Apr 13 15:12:56 UTC 2024


On Thursday, 11 April 2024 at 18:19:00 UTC, monkyyy wrote:
> With D3 either from phoboes or open d I was hoping there be the 
> will to update the range api to be just better, from my half 
> dozen posts trying to get something started; thats clearly not 
> the case.
>
>
> I highly suggest that changing the range api design to be post- 
> everyone practice and knowledge of templates and not based on 
> some essays for c++ in the 90's
>
> ---
>
> I made this proof of concept for a different api I thought 
> would be better 
> https://gist.github.com/crazymonkyyy/308bf3387ceec5c84883678d0fc097a7
>
> To summarize I believe iteration and "shaping" should be 
> separated; while ranges are "views of data" they should get a 
> "key" from an array reference that should be a "smart 
> reference" to real data. Rather then the stl concept of random 
> access iterators being a subset of bi-directional iterators.
>

Why I see the simplification I have a few questions.
Can you tell a learner what the benefits would be for an end user
(programmer not implementing libraries).

- Can this be extended for a complete substitution of Phobos' 
`std.algorithm`?

- Would this allow for @nogc or even -betterC throughout?



More information about the Digitalmars-d mailing list