Forward ranges in Phobos v2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Tue Nov 2 20:17:06 UTC 2021


On 2021-11-02 15:32, Adam D Ruppe 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...)

Yah, polymorphism has its place. The only problem is passing around 
reference ranges. They should have a thin struct wrapper that carries 
the proper copy semantics.


More information about the Digitalmars-d mailing list