seq advanced to the first matching element, or until empty if there are no
matching elements.
InputRange findAmong(alias pred = "a == b", InputRange, ForwardRange)(
InputRange seq, ForwardRange choices) if (isInputRange!InputRange && isForwardRange!ForwardRange)Searches the given range for an element that matches one of the given choices.
Advances seq by calling seq.popFront until either find!(pred)(choices, seq.front) is true, or seq becomes empty. Performs seq.length * choices.length evaluations of pred.
For more information about pred see find.
pred | The predicate to use for determining a match. |
seq | The input range to search. |
choices | A forward range of possible choices. |
seq advanced to the first matching element, or until empty if there are no
matching elements.