[Issue 1309] sorting arrays of structs is broken

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 28 11:11:27 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1309





------- Comment #1 from wbaxter at gmail.com  2008-11-28 13:11 -------
Just a stab in the dark, but you might try making the argument to opCmp 'const
MyStruct' or 'const MyStruct*'.  An opCmp shouldn't generally modify its
argument so maybe DMD expects a 'const' in the signature.

Also, when it comes to opCmp be aware of #1861.  At least in D1, using a
pointer argument works for .sort, but it doesn't work for regular a<b struct
comparisons.


-- 



More information about the Digitalmars-d-bugs mailing list