@@ -158,6 +158,7 @@ are true.
158158Checks if $(I _any) of the elements verifies $(D pred).
159159$(D !any) can be used to verify that $(I none) of the elements verify
160160$(D pred).
161+ This is sometimes called `exists` in other languages.
161162 +/
162163template any (alias pred = " a" )
163164{
@@ -740,6 +741,8 @@ size_t count(alias pred = "true", R)(R haystack)
740741 $(D startsWith!pred(haystack, needles)) is $(D true). If
741742 $(D startsWith!pred(haystack, needles)) is not $(D true) for any element in
742743 $(D haystack), then $(D -1) is returned.
744+
745+ See_Also: $(REF indexOf, std,string)
743746 +/
744747ptrdiff_t countUntil (alias pred = " a == b" , R, Rs... )(R haystack, Rs needles)
745748 if (isForwardRange! R
@@ -1666,6 +1669,8 @@ pred).
16661669To _find the last element of a bidirectional $(D haystack) satisfying
16671670$(D pred), call $(D find!(pred)(retro(haystack))). See $(REF retro, std,range).
16681671
1672+ `find` behaves similar to `dropWhile` in other languages.
1673+
16691674Params:
16701675
16711676pred = The predicate for determining if a given element is the one being
@@ -3262,6 +3267,7 @@ unittest
32623267/**
32633268Iterates the passed range and returns the minimal element.
32643269A custom mapping function can be passed to `map`.
3270+ In other languages this is sometimes called `argmin`.
32653271
32663272Complexity: O(n)
32673273 Exactly `n - 1` comparisons are needed.
@@ -3353,6 +3359,7 @@ auto minElement(alias map = "a", Range, RangeElementType = ElementType!Range)
33533359/**
33543360Iterates the passed range and returns the maximal element.
33553361A custom mapping function can be passed to `map`.
3362+ In other languages this is sometimes called `argmax`.
33563363
33573364Complexity:
33583365 Exactly `n - 1` comparisons are needed.
@@ -4260,10 +4267,11 @@ private void skipAll(alias pred = "a == b", R, Es...)(ref R r, Es es)
42604267}
42614268
42624269/**
4263- Interval option specifier for $(D until) (below) and others.
4270+ Interval option specifier for ` until` (below) and others.
42644271
42654272If set to $(D OpenRight.yes), then the interval is open to the right
42664273(last element is not included).
4274+ This is similar to `takeWhile` in other languages.
42674275
42684276Otherwise if set to $(D OpenRight.no), then the interval is closed to the right
42694277(last element included).
@@ -4410,8 +4418,8 @@ struct Until(alias pred, Range, Sentinel) if (isInputRange!Range)
44104418 import std.algorithm.comparison : equal;
44114419 import std.typecons : No;
44124420 int [] a = [ 1 , 2 , 4 , 7 , 7 , 2 , 4 , 7 , 3 , 5 ];
4413- assert (equal(a.until(7 ), [1 , 2 , 4 ][] ));
4414- assert (equal(a.until(7 , No.openRight), [1 , 2 , 4 , 7 ][] ));
4421+ assert (equal(a.until(7 ), [1 , 2 , 4 ]));
4422+ assert (equal(a.until(7 , No.openRight), [1 , 2 , 4 , 7 ]));
44154423}
44164424
44174425@safe unittest
@@ -4423,10 +4431,10 @@ struct Until(alias pred, Range, Sentinel) if (isInputRange!Range)
44234431 static assert (isForwardRange! (typeof (a.until(7 ))));
44244432 static assert (isForwardRange! (typeof (until! " a == 2" (a, No.openRight))));
44254433
4426- assert (equal(a.until(7 ), [1 , 2 , 4 ][] ));
4427- assert (equal(a.until([7 , 2 ]), [1 , 2 , 4 , 7 ][] ));
4428- assert (equal(a.until(7 , No.openRight), [1 , 2 , 4 , 7 ][] ));
4429- assert (equal(until! " a == 2" (a, No.openRight), [1 , 2 ][] ));
4434+ assert (equal(a.until(7 ), [1 , 2 , 4 ]));
4435+ assert (equal(a.until([7 , 2 ]), [1 , 2 , 4 , 7 ]));
4436+ assert (equal(a.until(7 , No.openRight), [1 , 2 , 4 , 7 ]));
4437+ assert (equal(until! " a == 2" (a, No.openRight), [1 , 2 ]));
44304438}
44314439
44324440unittest // bugzilla 13171
0 commit comments