Re: std.algorithm.sort with copy constructors

2020-04-14 Thread Gregor Mückl via Digitalmars-d-learn
On Monday, 13 April 2020 at 15:38:33 UTC, Steven Schveighoffer wrote: On 4/13/20 10:24 AM, Steven Schveighoffer wrote: This is a bug in phobos. https://issues.dlang.org/show_bug.cgi?id=20732 https://github.com/dlang/phobos/pull/7442 -Steve Sorry for sending you down that particular rabbit

Re: std.algorithm.sort with copy constructors

2020-04-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/13/20 10:24 AM, Steven Schveighoffer wrote: This is a bug in phobos. https://issues.dlang.org/show_bug.cgi?id=20732 https://github.com/dlang/phobos/pull/7442 -Steve

Re: std.algorithm.sort with copy constructors

2020-04-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/13/20 9:27 AM, Gregor Mückl wrote: import std; struct S {     pure this(ref return scope const S rhs) nothrow @nogc {     this.x = x;     }     int x; } void main() {     S[] array = new S[10];     array.sort!("a.x < b.x", SwapStrategy.stable); } This is a bug in phobos. http

std.algorithm.sort with copy constructors

2020-04-13 Thread Gregor Mückl via Digitalmars-d-learn
Hi! Consider the following code: --- import std; struct S { pure this(ref return scope const S rhs) nothrow @nogc { this.x = x; } int x; } void main() { S[] array = new S[10]; array.sort!("a.x < b.x", SwapStrategy.stable); } --- In this program, sort compiles on