std.algorithm: {min,max}Element for a single range

This commit is contained in:
Sebastian Wilzbach 2016-02-25 12:11:01 +02:00
parent d2740c4498
commit e3d0aa9724
3 changed files with 292 additions and 0 deletions

View file

@ -1270,6 +1270,9 @@ Params:
Returns:
The maximum of the passed-in args. The type of the returned value is
the type among the passed arguments that is able to store the largest value.
See_Also:
$(XREF_PACK algorithm,searching,maxElement)
*/
MaxType!T max(T...)(T args)
if (T.length >= 2)
@ -1382,6 +1385,8 @@ Iterates the passed arguments and returns the minimum value.
Params: args = The values to select the minimum from. At least two arguments
must be passed, and they must be comparable with `<`.
Returns: The minimum of the passed-in values.
See_Also:
$(XREF_PACK algorithm,searching,minElement)
*/
MinType!T min(T...)(T args)
if (T.length >= 2)