Sorting an Array

okibi okibi at ratedo.com
Tue Jul 10 12:09:20 PDT 2007


Same issue.


torhu Wrote:

> okibi wrote:
> > I couldn't get your function to compile. I get the following error:
> > 
> > Error: need 'this' to access member getNumericPart
> > 
> > On the line:
> > 
> > return getNumericPart(a)>getNumericPart(b);
> > 
> > Any ideas?
> 
> That's odd. Try this instead, maybe there's a conflict with the sort 
> attribute.
> 
>     sort(array, function(char[] a, char[] b) {
>       return getNumericPart(a)>getNumericPart(b);
>     });



More information about the Digitalmars-d-learn mailing list