Forward ranges in Phobos v2

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Nov 2 19:44:02 UTC 2021


On Tue, Nov 02, 2021 at 07:32:56PM +0000, Adam D Ruppe via Digitalmars-d wrote:
> On Tuesday, 2 November 2021 at 18:09:55 UTC, H. S. Teoh wrote:
> > Why is this necessary?  I thought we're getting rid of
> > std.range.interfaces.
> 
> It is actually really, really, useful. If phobos didn't offer it,
> someone would reinvent it anyway.
> 
> (In fact, there's a lot of cases where using them is more efficient
> than generating more and more code...)

I find it very useful as well, but according to Andrei, v2 will get rid
of class-based ranges, and if those are wanted we should use a struct
wrapper instead.

In any case, if struct wrappers are the way to go, then we better have a
standard way of constructing them.  It just won't be the same thing as
std.range.interfaces.


T

-- 
They say that "guns don't kill people, people kill people." Well I think the gun helps. If you just stood there and yelled BANG, I don't think you'd kill too many people. -- Eddie Izzard, Dressed to Kill


More information about the Digitalmars-d mailing list