looking for a D3 stl project

Nickolay Bukreyev buknik95 at ya.ru
Mon Jan 15 22:43:33 UTC 2024


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.


More information about the Digitalmars-d mailing list