mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 07:30:33 +03:00
Update searching.d
Minor change to minElement example to remove ambiguity between min element value and min element index.
This commit is contained in:
parent
d10a9da36b
commit
347b5a3164
1 changed files with 1 additions and 1 deletions
|
@ -3445,7 +3445,7 @@ auto minElement(Range, RangeElementType = ElementType!Range)
|
|||
import std.range : enumerate;
|
||||
import std.typecons : tuple;
|
||||
|
||||
assert([2, 1, 4, 3].minElement == 1);
|
||||
assert([2, 7, 1, 3].minElement == 1);
|
||||
|
||||
// allows to get the index of an element too
|
||||
assert([5, 3, 7, 9].enumerate.minElement!"a.value" == tuple(1, 3));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue