On Fri, 16 Sep 2011 23:38:35 +0200, Andrei Alexandrescu <[email protected]> wrote:

extremum!"a<b"([1,2,3,1,2,3]) would be equal to [1,1].

(BTW I thought of just returning the first found, so only 1.)

Will there then be a different version (extremumArg?) that does return a
range? Consider bearophile's example of min!"a.length" - it is not
unlikely there will be several elements with an equal length.

A corner case:
    extremum!"a<0"([1]) == ???
Does this throw? If so, how do we determine that?

I implemented the functions as I have understood them, and attached them
to this post. Permission is given to use this code in any way desired,
at own risk. (WTF license or less limiting)

Note that I have chosen to use the name extremum in the absense of
better options.

--
  Simen

Attachment: extremum.d
Description: Binary data

Reply via email to