Forward ranges in Phobos v2

Dukc ajieskola at gmail.com
Wed Nov 3 11:54:24 UTC 2021


On Wednesday, 3 November 2021 at 00:18:59 UTC, Paul Backus wrote:
>
> Having input ranges implement `next` and forward ranges 
> implement `head` and `tail` would also make them easy to 
> distinguish.

There's an easier solution: require all v2 ranges to have the 
`inputRangeTag`. For forward ranges it must be set to false, but 
if the tag does not exist at all then it isn't a v2 range.

If we go for this, I'd rename the tag to `isReferenceRange` 
though.

It's going to require more manual usage of the `valueRange` 
wrapper though, as the v1 ranges around aren't going to be v2 
ranges as often.

What do you say?


More information about the Digitalmars-d mailing list