Forward ranges in Phobos v2
Alexandru Ermicioi
alexandru.ermicioi at gmail.com
Mon Nov 1 23:34:20 UTC 2021
On Monday, 1 November 2021 at 14:13:00 UTC, H. S. Teoh wrote:
> If you have a struct but it only supports input range
> semantics, then you could pass it by ref or pass a pointer to
> it.
>
> If you have a class but it supports forward range semantics,
> then wrap it in a struct with a copy ctor that saves state in
> the copy ctor.
>
>
> T
What about random access range?
If you don't care for the implementation of the range but only
being a forward range, how would you express it as a parameter
for a method?
Best regards,
Alexandru.
More information about the Digitalmars-d
mailing list