Thread overview
[Issue 21429] Cannot sort large tuple arrays at compile time
Nov 26, 2020
Max Samukha
May 03, 2021
Berni44
May 03, 2021
Berni44
Nov 04, 2021
Tim
Dec 17, 2022
Iain Buclaw
November 26, 2020
https://issues.dlang.org/show_bug.cgi?id=21429

Max Samukha <maxsamukha@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE

--
May 03, 2021
https://issues.dlang.org/show_bug.cgi?id=21429

Berni44 <bugzilla@bernis-buecher.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@bernis-buecher.de

--- Comment #1 from Berni44 <bugzilla@bernis-buecher.de> ---
Meanwhile n == 100 produces:

/home/D/Repo/dmd/generated/linux/release/64/../../../../../druntime/import/core/lifetime.d(2105):
Error: `memcpy` cannot be interpreted at compile time, because it has no
available source code

(using DMD64 D Compiler v2.096.1-242-g9fd50d0be)

It still works for n <= 5.

--
May 03, 2021
https://issues.dlang.org/show_bug.cgi?id=21429

Berni44 <bugzilla@bernis-buecher.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=21888

--
November 04, 2021
https://issues.dlang.org/show_bug.cgi?id=21429

Tim <tim.dlang@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim.dlang@t-online.de

--- Comment #2 from Tim <tim.dlang@t-online.de> ---
It also fails for small arrays, but only if some elements have to be swapped:

enum x = (){
    import std.algorithm, std.typecons;
    auto x = [tuple!int(2), tuple!int(1)];
    x.sort;
    return x;
}();

The problem can also be reproduced by calling swap directly:

enum x = (){
    import std.algorithm, std.typecons;
    Tuple!int a, b;
    swap(a, b);
    return 0;
}();

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21429

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 18
https://issues.dlang.org/show_bug.cgi?id=21429

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #3 from Nick Treleaven <nick@geany.org> ---
I've split out the swap error to issue #24285.
With the swap fix, the comment #1 error still happens.

--