mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 09:00:22 +03:00
Cross-reference among
from canFind
.
For newbies' ease of discovering the right function to use (issue 13467).
This commit is contained in:
parent
0fb1bee92d
commit
0b6bfd5aa7
1 changed files with 5 additions and 1 deletions
|
@ -11477,6 +11477,9 @@ unittest
|
||||||
/++
|
/++
|
||||||
Convenience function. Like find, but only returns whether or not the search
|
Convenience function. Like find, but only returns whether or not the search
|
||||||
was successful.
|
was successful.
|
||||||
|
|
||||||
|
See_Also:
|
||||||
|
$(XREF algorithm, among) for checking a range against multiple possibilities.
|
||||||
+/
|
+/
|
||||||
template canFind(alias pred="a == b")
|
template canFind(alias pred="a == b")
|
||||||
{
|
{
|
||||||
|
@ -13718,7 +13721,8 @@ is not _among $(D values). The predicate $(D pred) is used to
|
||||||
compare values, and uses equality by default.
|
compare values, and uses equality by default.
|
||||||
|
|
||||||
See_Also:
|
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...)
|
uint among(alias pred = (a, b) => a == b, Value, Values...)
|
||||||
(Value value, Values values)
|
(Value value, Values values)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue