looking for a D3 stl project
monkyyy
crazymonkyyy at gmail.com
Mon Jan 15 22:52:05 UTC 2024
On Monday, 15 January 2024 at 22:43:33 UTC, Nickolay Bukreyev
wrote:
> On Monday, 15 January 2024 at 22:08:30 UTC, monkyyy wrote:
>> Its an optional feature even in my example code.
>
> Sorry, I misunderstood you. So you suggest that `.index` should
> be a primitive operation of an iterator. But then every
> iterator transformer (`map`, `filter`, `retro`, `take`,
> hundreds of them) would have to implement it if the underlying
> iterator implements it. This makes construction of new iterator
> transformers harder than it ought to be.
>
> In Phobos, on the other hand, the index feature is decoupled
> from ranges’ implementation: if you need an index, you do
> `.enumerate`, and no other range cares about indices.
>
> Of course, it’s up to you how you design it. I just presented a
> different point of view on that.
right now they implement 20 ish functions to support "random
access ranges" and can have drastic differences if you dont met
something like "bidirectional" which is why some of the range
functions are like 300 lines long
yes, template hell is part of this
I would hope to make it simpler then 20 functions, but I dont
know.
More information about the Digitalmars-d
mailing list