Skip to content

Commit

Permalink
Merge pull request #2532 from quickfur/issue13467
Browse files Browse the repository at this point in the history
Cross-reference `among` from `canFind`.
  • Loading branch information
CyberShadow committed Sep 19, 2014
2 parents 0fb1bee + 0b6bfd5 commit bf4cadb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion std/algorithm.d
Expand Up @@ -11477,6 +11477,9 @@ unittest
/++
Convenience function. Like find, but only returns whether or not the search
was successful.
See_Also:
$(XREF algorithm, among) for checking a range against multiple possibilities.
+/
template canFind(alias pred="a == b")
{
Expand Down Expand Up @@ -13718,7 +13721,8 @@ is not _among $(D values). The predicate $(D pred) is used to
compare values, and uses equality by default.
See_Also:
$(XREF algorithm, find) for finding a value in a range.
$(XREF algorithm, find) and $(XREF algorithm, canFind) for finding a value in a
range.
*/
uint among(alias pred = (a, b) => a == b, Value, Values...)
(Value value, Values values)
Expand Down

0 comments on commit bf4cadb

Please sign in to comment.