Good/Bad? @disable postblit for struct InputRange

Nick Sabalausky via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 5 22:38:07 PDT 2014


On 9/5/2014 6:14 PM, monarch_dodra wrote:
>
> Ref semantics is one option, yes. Either by class, or by struct. For
> example, most IO ranges implemented ref-counted reference semantics.
>
> IMO, disabling postblit is overkill, as almost anything that does
> anything with ranges will pass them by value at one point or another.
>
[...]
>
> *Ideally*, these functions would do a move-return, and you'd
> pass-by-move, so you'd be able to effectively disable postblit, but
> still pass by move-value. Unfortunately, we aren't quite there yet...
>

I see. Good points, thanks.



More information about the Digitalmars-d-learn mailing list