While checking https://issues.dlang.org/show_bug.cgi?id=21429 I noticed a regression: Meanwhile medium sized sorting, like
import std.algorithm;
import std.typecons;
auto foo() {
enum n = 100;
auto x = new Tuple!int[n];
x.sort;
return x;
}
enum a = foo;
void main() {
}
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
with DMD64 D Compiler v2.096.1-242-g9fd50d0be
The error seems to be in std.algorithm.sorting: shortSort. It has specialized routines for the cases <= 5 and is called for not too large ranges (here up to 256), depending on the size of the elements.
With DMD64 D Compiler v2.090.1 it works.
According to https://run.dlang.io/is/VM5Ufp it was introduced between 2.093.1 and 2.094.1.
Comment #1 by robert.schadek — 2024-12-01T16:38:49Z