There should be overloads of min and max with a predicate, e.g. the code below chooses the shortest string out of three:
string x, y;
...
auto s = min!((a, b) => a.length < b.length)(x, y, "hello");
Comment #1 by andrei — 2015-03-16T17:28:53Z
Oops, sorry, I meant unary predicates (the "<" is implied):
string x, y;
...
auto s = min!(a => a.length)(x, y, "hello");
Comment #2 by bearophile_hugs — 2015-03-16T18:51:34Z
This is an almost five years old enhancement request of mine.
*** This issue has been marked as a duplicate of issue 4705 ***