.sort vs sort(): std.algorithm not up to the task?

Era Scarecrow via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 7 20:30:17 PDT 2017


On Thursday, 8 June 2017 at 02:19:15 UTC, Andrew Edwards wrote:
> Pretty funny. But seriously, this is something that should just 
> work. There is now to layers of indirection to achieve what I 
> used to do quite naturally in the language.

  Hmmm while working on my recent sudoku solver using pointers to 
structs, i had opCmp defined, but it was still sorting by pointer 
address rather than how i told it to sort; I had to give it the 
hint of sort!"*a < *b" for it to work right.

  It does seem like a little more duct-tape on the wizard is 
needed in some cases. Thankfully it isn't too complex to know 
where to tape the wand into the wizard's hand.


More information about the Digitalmars-d-learn mailing list