How is chunkBy supposed to behave on copy
Pezbi Mahn
pezbiworkemail at gmail.com
Mon Mar 23 18:18:27 UTC 2020
That’s dope homie
On Mon, Mar 23, 2020 at 2:15 PM Jonathan M Davis via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:
> On Sunday, March 22, 2020 9:43:45 AM MDT H. S. Teoh via Digitalmars-d
> wrote:
> > On Fri, Mar 20, 2020 at 05:50:26PM -0600, Jonathan M Davis via
> > Digitalmars-d wrote: [...]
> >
> > > And exactly what should happen with basic input ranges is not clear,
> > > because while ideally, you'd just require that they have full-on
> > > reference semantics, that tends to mean that you're forcing them to be
> > > allocated on the heap, which isn't really the sort of thing that we
> > > want to force if we can avoid it.
> >
> > [...]
> >
> > You could just have input ranges be a struct with the copy ctor
> > @disable'd, perhaps?
>
> A range that can't be copied is useless. It won't even work with foreach,
> because anything you iterate over with foreach is copied when it's passed
> to
> foreach. And of course, idiomatic range code passes ranges all over the
> place, resulting in a lot of copying. And to wrap a range in another range
> (which is required for most range-based algorithms), you have to copy it.
> IMHO, it would make far more sense to just use opApply than to try to make
> a
> range non-copyable.
>
> - Jonathan M Davis
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200323/ec6755d5/attachment.htm>
More information about the Digitalmars-d
mailing list