Language Idea #6892: in array ops, enable mixing slices and random access ranges

Guillaume Piolat notthat at email.com
Tue Feb 6 12:13:22 UTC 2018


On Tuesday, 6 February 2018 at 09:02:46 UTC, Simen Kjærås wrote:
> On Tuesday, 6 February 2018 at 02:14:35 UTC, Meta wrote:
>>> What do you think?
>>
>> It's already possible, with only very slightly worse 
>> aesthetics:
>>
> [Good stuff]
>
> We can do better than that, though:
>
> [More good stuff]

The problem in your sample is that you turn a range into a new 
slice with .array (which is "alias this" also), and this 
allocates.

Meta's solution brings slices into the range world instead 
(rather than ranges to array ops like originally proposed).



More information about the Digitalmars-d mailing list