Is there something like a consuming take?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sun Jul 7 09:03:51 UTC 2019


On Saturday, July 6, 2019 12:58:52 PM MDT Adam D. Ruppe via Digitalmars-d-
learn wrote:
> On Saturday, 6 July 2019 at 18:17:26 UTC, Jonathan M Davis wrote:
> > take _always_ consumes the range that it's given
>
> not if it hasSlicing. see
> http://dpldocs.info/experimental-docs/source/std.range.d.html#L2015
>
> but yeah otherwise i agree with you

True enough, though if the code is generic, it still pretty much has to
assume that the range was consumed.

- Jonathan M Davis





More information about the Digitalmars-d-learn mailing list