View source code
Display the source code in std/algorithm/searching.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Function std.algorithm.searching.skipOver.skipOver
bool skipOver(Haystack, Needles...)
(
ref Haystack haystack,
Needles needles
)
if (is(typeof(binaryFun!pred(haystack .front, needles[0] .front))) && isForwardRange!Haystack && allSatisfy!(isInputRange, Needles) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Needles))) == void));
bool skipOver(R)
(
ref R r1
)
if (isForwardRange!R && ifTestable!(typeof(r1 .front), unaryFun!pred));
bool skipOver(R, Es...)
(
ref R r,
Es es
)
if (isInputRange!R && is(typeof(binaryFun!pred(r .front, es[0]))));
Parameters
Name | Description |
---|---|
haystack | The forward range to move forward. |
needles | The input ranges
representing the prefix of r1 to skip over. |
es | The element to match. |
Returns
true
if the prefix of haystack
matches any range of needles
fully
or pred
evaluates to true, and haystack
has been advanced to the point past this segment;
otherwise false, and haystack
is left in its original position.
Note
By definition, empty ranges are matched fully and if needles
contains an empty range,
skipOver
will return true
.
Authors
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.