[string.view.find] (original) (raw)

27 Strings library [strings]

27.3 String view classes [string.view]

27.3.3 Class template basic_string_view [string.view.template]

27.3.3.9 Searching [string.view.find]

Member functions in this subclause have complexity at worst, although implementations should do better.

Let F be one offind,rfind,find_first_of,find_last_of,find_first_not_of, andfind_last_not_of.

constexpr size_type find(basic_string_view str, size_type pos = 0) const noexcept;

Let xpos be the lowest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.

constexpr size_type rfind(basic_string_view str, size_type pos = npos) const noexcept;

Let xpos be the highest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.

constexpr size_type find_first_of(basic_string_view str, size_type pos = 0) const noexcept;

Let xpos be the lowest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.

constexpr size_type find_last_of(basic_string_view str, size_type pos = npos) const noexcept;

Let xpos be the highest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.

constexpr size_type find_first_not_of(basic_string_view str, size_type pos = 0) const noexcept;

Let xpos be the lowest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.

constexpr size_type find_last_not_of(basic_string_view str, size_type pos = npos) const noexcept;

Let xpos be the highest position, if possible, such that the following conditions hold:

Effects: Determines xpos.

Returns: xpos if the function can determine such a value for xpos.

Otherwise, returns npos.