extrema

fnElementType!Range[2] extrema(Range)(Range r) if (isInputRange!Range && !isInfinite!Range)

Returns an array of the minimum and maximum element in r. Performs < 3n/2 comparisons, unlike the naive < 2n.

Parameters

rThe range to traverse.