sort!("...") with template function?
Vladimirs Nordholm
v at vladde.net
Mon Feb 25 12:37:31 UTC 2019
Hello.
I wish to sort an array by calling a template function on a
struct. In essence I want to do
foos.sort!("a.get!Dummy < b.get!Dummy");
but I get the error message
/dlang/dmd/linux/bin64/../../src/phobos/std/functional.d-mixin-215(215): Error: undefined identifier Dummy
Is there anyway I can get `sort` to recognise my Dummy type?
Example: https://run.dlang.io/is/9zDfdd
More information about the Digitalmars-d-learn
mailing list