findAmong

fnInputRange 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.

Parameters

predThe predicate to use for determining a match.
seqThe input range to search.
choicesA forward range of possible choices.

Returns

seq advanced to the first matching element, or until empty if there are no

matching elements.

See Also