std.range's put on arrays needs to change

Steven Schveighoffer schveiguy at gmail.com
Sun Jun 26 12:58:27 UTC 2022


On 6/26/22 6:29 AM, H. S. Teoh wrote:
> On Sun, Jun 26, 2022 at 06:33:13AM +0000, Kostiantyn Tokar via Digitalmars-d wrote:
> [...]
>> What should I do if I want to preallocate a slice and copy some input range
>> into it? I wouldn't be able to use `std.algorithm.copy` for this simple
>> purpose, because it uses `put` internally.
> 
> Just take a slice of it with [].

Taking a slice of a slice does nothing.

-Steve


More information about the Digitalmars-d mailing list