Segmentation fault on sort

monarch_dodra monarchdodra at gmail.com
Sat Jan 4 01:03:25 PST 2014


On Saturday, 4 January 2014 at 08:00:53 UTC, Dfr wrote:
> I just thought that "Color" is struct, so it is value type and 
> should be sorted like tuple without extra handwork, isn't it ?

Unfortunately, no. You need to add an opCmp to your struct.

> So how i understood it: 'sort' is old buggy sort, but when 
> added parens 'sort()' - now this is nice phobos sort, correct ?

Yes. The idea is that it should be (will be) deprecated. Pretty 
soon, using it will lead to a deprecation warning, and then will 
be removed outright.

Once removed outright, then calling it without parens will call 
the correct std.algorithm.sort, "parentless-style"




More information about the Digitalmars-d-learn mailing list