Re: "Overlapping array copy" exception sorting an array of Tuples

2011-03-07 Thread bearophile
André Stein: > I'm trying to sort an array of tuples (Tuple!(uint, string) type) but the > program bails out with the exception "overlapping array copy" http://d.puremagic.com/issues/show_bug.cgi?id=5716 I think Phobos unittests are seriously lacking. Bye, bearophile

Re: "Overlapping array copy" exception sorting an array of Tuples

2011-03-07 Thread Jonathan M Davis
On Monday, March 07, 2011 10:38:44 André Stein wrote: > I tried both signatures of opCmp but the result seemed the same (both > sequences of structs sorted correctly). So I wonder what is the default > comparison of a user defined struct type? Not implementing an opCmp > function lead to a compile

Re: "Overlapping array copy" exception sorting an array of Tuples

2011-03-07 Thread André Stein
Hi, Thanks first for your detailed reply! On 03/07/2011 07:21 PM, Jonathan M Davis wrote: Well, Tuple _is_ a struct, so if it's failing with Tuple, it's not going to work with just any struct (though apparently it works just fine with the struct that you wrote). Regardless, it definitely sounds

Re: "Overlapping array copy" exception sorting an array of Tuples

2011-03-07 Thread Jonathan M Davis
On Monday, March 07, 2011 06:36:31 Andr� Stein wrote: > Hi, > > I'm trying to sort an array of tuples (Tuple!(uint, string) type) but the > program bails out with the exception "overlapping array copy" > (arraycat.d(40)). To make things short here is the source code: > > import std.typecons; >

"Overlapping array copy" exception sorting an array of Tuples

2011-03-07 Thread Andr� Stein
Hi, I'm trying to sort an array of tuples (Tuple!(uint, string) type) but the program bails out with the exception "overlapping array copy" (arraycat.d(40)). To make things short here is the source code: import std.typecons; import std.algorithm; void main(string[] args) { alias Tuple!(uint,