Showing with 5 additions and 5 deletions.
  1. +5 −5 std/algorithm/searching.d
10 changes: 5 additions & 5 deletions std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ if (isRandomAccessRange!R1 && hasLength!R1 && hasSlicing!R1 && isBidirectionalRa
}

/// ditto
R1 find(alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
R1 find(alias pred = "a == b", R1, R2)(R1 haystack, scope R2 needle)
if (isRandomAccessRange!R1 && isForwardRange!R2 && !isBidirectionalRange!R2 &&
is(typeof(binaryFun!pred(haystack.front, needle.front)) : bool))
{
Expand Down Expand Up @@ -1967,7 +1967,7 @@ if (isRandomAccessRange!R1 && isForwardRange!R2 && !isBidirectionalRange!R2 &&
}

// Internally used by some find() overloads above
private R1 simpleMindedFind(alias pred, R1, R2)(R1 haystack, R2 needle)
private R1 simpleMindedFind(alias pred, R1, R2)(R1 haystack, scope R2 needle)
{
enum estimateNeedleLength = hasLength!R1 && !hasLength!R2;

Expand Down Expand Up @@ -2238,7 +2238,7 @@ if (Ranges.length > 1 && is(typeof(startsWith!pred(haystack, needles))))
* such position exists, returns $(D haystack) advanced to termination).
*/
Range1 find(Range1, alias pred, Range2)(
Range1 haystack, BoyerMooreFinder!(pred, Range2) needle)
Range1 haystack, scope BoyerMooreFinder!(pred, Range2) needle)
{
return needle.beFound(haystack);
}
Expand Down Expand Up @@ -2303,7 +2303,7 @@ template canFind(alias pred="a == b")
Returns $(D true) if and only if $(D needle) can be found in $(D
range). Performs $(BIGOH haystack.length) evaluations of $(D pred).
+/
bool canFind(Range, Element)(Range haystack, Element needle)
bool canFind(Range, Element)(Range haystack, scope Element needle)
if (is(typeof(find!pred(haystack, needle))))
{
return !find!pred(haystack, needle).empty;
Expand All @@ -2320,7 +2320,7 @@ template canFind(alias pred="a == b")
without having to deal with the tuple that $(D LREF find) returns for the
same operation.
+/
size_t canFind(Range, Ranges...)(Range haystack, Ranges needles)
size_t canFind(Range, Ranges...)(Range haystack, scope Ranges needles)
if (Ranges.length > 1 &&
allSatisfy!(isForwardRange, Ranges) &&
is(typeof(find!pred(haystack, needles))))
Expand Down