Comment #2 by n8sh.secondary — 2019-06-23T14:02:20Z
The `std.algorithm.*` packages are for working on input ranges, which static arrays are not. I think accepting them isn't a bad idea but I'm going to relabel this from "bug" to "enhancement" and change the title to reflect this.
Comment #3 by shove — 2019-06-24T09:49:10Z
(In reply to feklushkin.denis from comment #0)
> import std.algorithm.mutation;
>
> void main()
> {
> ubyte[2] a = [ 1, 5 ];
> ubyte[] buf;
> buf.length = 40;
>
> auto rem = a.copy(buf); // worked on 2.085.1, broken in 2.086
> }
>
> Error message:
>
> onlineapp.d(10): Error: template std.algorithm.mutation.copy cannot deduce
> function from argument types !()(ubyte[2], ubyte[]), candidates are:
> /dlang/dmd-beta/linux/bin64/../../src/phobos/std/algorithm/mutation.d(368):
> std.algorithm.mutation.copy(SourceRange, TargetRange)(SourceRange source,
> TargetRange target) if (isInputRange!SourceRange &&
> isOutputRange!(TargetRange, ElementType!SourceRange))
Before this question is pending, you can:
import std.algorithm.mutation;
void main()
{
ubyte[2] a = [ 1, 5 ];
ubyte[] buf;
buf.length = 40;
auto rem = a[0 .. $].copy(buf); // worked on 2.085.1, broken in 2.086
}
Comment #4 by feklushkin.denis — 2019-06-24T11:52:53Z