Thread overview
[Issue 19835] Make std.algorithm.mutation.copy accept static arrays as sources
[Issue 19835] std.algorithm.mutation.copy static array source argument broken
Jun 13, 2019
Dlang Bot
Jun 23, 2019
Nathan S.
Jun 23, 2019
Nathan S.
Jun 24, 2019
shove
Jul 06, 2019
shove
June 13, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@shove70 created dlang/phobos pull request #7070 "Fix issue 19835 - std.algorithm.mutation.copy static array source arg…" fixing this issue:

- Fix issue 19835 - std.algorithm.mutation.copy static array source argument broken

https://github.com/dlang/phobos/pull/7070

--
June 23, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

Nathan S. <n8sh.secondary@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |n8sh.secondary@hotmail.com

--- Comment #2 from Nathan S. <n8sh.secondary@hotmail.com> ---
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.

--
June 23, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

Nathan S. <n8sh.secondary@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
            Summary|std.algorithm.mutation.copy |Make
                   |static array source         |std.algorithm.mutation.copy
                   |argument broken             |accept static arrays as
                   |                            |sources
                 OS|Linux                       |All
           Severity|normal                      |enhancement

--
June 24, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

shove <shove@163.com> changed:

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

--- Comment #3 from shove <shove@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
}

--
June 24, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

--- Comment #4 from feklushkin.denis@gmail.com ---
Thanks!

--
July 06, 2019
https://issues.dlang.org/show_bug.cgi?id=19835

shove <shove@163.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--