std.v2020.algorithm etc[ WAS: Is run.d going to be expand for runtime and the phobos library?]
Timon Gehr
timon.gehr at gmx.ch
Sun Jun 21 22:06:09 UTC 2020
On 20.06.20 16:51, Andrei Alexandrescu wrote:
>
> Input ranges should have only one API:
>
> bool fetchNext(T& target);
>
> Fill the user-provided target with the next element and return true. At
> the end of the range, return false and leave the target alone.
What if the caller does not know how to construct a T?
Nullable!T fetchNext();
(I get that D's support for algebraic data types is subpar, but maybe
that is something to look into.)
More information about the Digitalmars-d
mailing list