[Issue 19835] Make std.algorithm.mutation.copy accept static arrays as sources

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 24 09:49:10 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19835

shove <shove at 163.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shove at 163.com

--- Comment #3 from shove <shove at 163.com> ---
(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
}

--


More information about the Digitalmars-d-bugs mailing list