Fix issue 18735 all versions of find and canfind should identify usage of predicate

This commit is contained in:
Iulia Dumitru 2022-07-23 16:46:57 +03:00 committed by The Dlang Bot
parent 05cf9c260b
commit d0c52225b4

View file

@ -2512,6 +2512,8 @@ RandomAccessRange find(RandomAccessRange, alias pred, InputRange)(
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.
For more information about `pred` see $(LREF find).
See_Also: See_Also:
$(REF among, std,algorithm,comparison) for checking a value against multiple possibilities. $(REF among, std,algorithm,comparison) for checking a value against multiple possibilities.
+/ +/
@ -2622,6 +2624,8 @@ Advances `r` until it finds the first two adjacent elements `a`,
`b` that satisfy `pred(a, b)`. Performs $(BIGOH r.length) `b` that satisfy `pred(a, b)`. Performs $(BIGOH r.length)
evaluations of `pred`. evaluations of `pred`.
For more information about `pred` see $(LREF find).
Params: Params:
pred = The predicate to satisfy. pred = The predicate to satisfy.
r = A $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to r = A $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to
@ -2698,6 +2702,8 @@ Advances `seq` by calling `seq.popFront` until either
`find!(pred)(choices, seq.front)` is `true`, or `seq` becomes empty. `find!(pred)(choices, seq.front)` is `true`, or `seq` becomes empty.
Performs $(BIGOH seq.length * choices.length) evaluations of `pred`. Performs $(BIGOH seq.length * choices.length) evaluations of `pred`.
For more information about `pred` see $(LREF find).
Params: Params:
pred = The predicate to use for determining a match. pred = The predicate to use for determining a match.
seq = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to seq = The $(REF_ALTTEXT input range, isInputRange, std,range,primitives) to
@ -2758,6 +2764,8 @@ if (isInputRange!InputRange && isForwardRange!ForwardRange)
* Similarly, the haystack is positioned so as `pred` evaluates to `false` for * Similarly, the haystack is positioned so as `pred` evaluates to `false` for
* `haystack.front`. * `haystack.front`.
* *
* For more information about `pred` see $(LREF find).
* Params: * Params:
* haystack = The * haystack = The
* $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to search * $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) to search
@ -2882,6 +2890,8 @@ $(REF_ALTTEXT forward range, isForwardRange, std,range,primitives) and
the type of `result[0]` and `result[1]` is the same as $(REF takeExactly, the type of `result[0]` and `result[1]` is the same as $(REF takeExactly,
std,range). std,range).
For more information about `pred` see $(LREF find).
Params: Params:
pred = Predicate to use for comparing needle against haystack. pred = Predicate to use for comparing needle against haystack.
haystack = The range to search. haystack = The range to search.
@ -4595,6 +4605,8 @@ $(REF_ALTTEXT input range, isInputRange, std,range,primitives) starts with (one
of) the given needle(s) or, if no needles are given, of) the given needle(s) or, if no needles are given,
if its front element fulfils predicate `pred`. if its front element fulfils predicate `pred`.
For more information about `pred` see $(LREF find).
Params: Params:
pred = Predicate to use in comparing the elements of the haystack and the pred = Predicate to use in comparing the elements of the haystack and the