qfind_first_of overloads
Synopses
Declared in <folly/Range.h>
Finds the first occurrence of any element of needle in haystack. The algorithm is O(haystack.size() * needle.size()).
template<class Iter>
size_t
qfind_first_of(
Range<Iter> const& haystack,
Range<Iter> const& needle);
template<>
size_t
qfind_first_of<char const*>(
Range<char const*> const& haystack,
Range<char const*> const& needles);
template<>
size_t
qfind_first_of<unsigned char const*>(
Range<unsigned char const*> const& haystack,
Range<unsigned char const*> const& needles);
Find the first occurrence of any element of needles in haystack, using a custom comparator.
template<
class Iter,
class Comp>
size_t
qfind_first_of(
Range<Iter> const& haystack,
Range<Iter> const& needles,
Comp eq);
Return Value
The offset of the first match, or npos if not found.
Parameters
Name |
Description |
haystack |
The range to search within. |
needle |
The set of elements to search for. |
needles |
The set of elements to search for. |
eq |
The equality comparison used to match elements. |
Created with MrDocs