Skip to content

Commit

Permalink
[changelog entry] std.algorithm.searching.{min,max}Element
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Apr 29, 2016
1 parent 6f6f61c commit e714893
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions changelog.dd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ $(BUGSTITLE Library Changes,
rangified.)
$(LI All overloads of `std.conv.toImpl` has been made private. Please use
$(XREF conv, to) instead.)
$(LI $(RELATIVE_LINK2 min-max-element,
`std.algorithm.searching.{min,max}Element` for ranges have been added.))
)

$(BUGSTITLE Library Changes,
Expand Down Expand Up @@ -102,6 +104,22 @@ $(LI $(LNAME2 iota-length-size_t, `std.range.iota's `.length` property is fixed
)
)

$(LI $(LNAME2 min-max-element, `std.algorithm.searching.{min,max}Element`
have been added.)
$(P $(XREF algorithm, searching, minElement) and $(XREF algorithm,
searching, maxElement) are functions to search for the minimum and maximum
element in a range. They support a custom `map` accessor.
)

-------
import std.algorithm.searching;
import std.range;
import std.typecons;
assert([3, 1, 4].minElement == 1);
assert([4, 7, 5].enumerate.maxElement!`a.value` == tuple(1, 7));
-------
)

)

Macros:
Expand Down

0 comments on commit e714893

Please sign in to comment.