[string.find] (original) (raw)
27 Strings library [strings]
27.4 String classes [string.classes]
27.4.3 Class template basic_string [basic.string]
27.4.3.8 String operations [string.ops]
27.4.3.8.2 Searching [string.find]
Let F be one offind, rfind, find_first_of, find_last_of,find_first_not_of, and find_last_not_of.
- Each member function of the formconstexpr size_type F(const basic_string& str, size_type pos) const noexcept;has effects equivalent to:return F(basic_string_view<charT, traits>(str), pos);
- Each member function of the formconstexpr size_type F(const charT* s, size_type pos) const;has effects equivalent to:return F(basic_string_view<charT, traits>(s), pos);
- Each member function of the formconstexpr size_type F(const charT* s, size_type pos, size_type n) const;has effects equivalent to:return F(basic_string_view<charT, traits>(s, n), pos);
- Each member function of the formconstexpr size_type F(charT c, size_type pos) const noexcept;has effects equivalent to:return F(basic_string_view<charT, traits>(addressof(c), 1), pos);
template<class T> constexpr size_type find(const T& t, size_type pos = 0) const noexcept(_see below_);template<class T> constexpr size_type rfind(const T& t, size_type pos = npos) const noexcept(_see below_);template<class T> constexpr size_type find_first_of(const T& t, size_type pos = 0) const noexcept(_see below_);template<class T> constexpr size_type find_last_of(const T& t, size_type pos = npos) const noexcept(_see below_);template<class T> constexpr size_type find_first_not_of(const T& t, size_type pos = 0) const noexcept(_see below_);template<class T> constexpr size_type find_last_not_of(const T& t, size_type pos = npos) const noexcept(_see below_);
Constraints:
- is_convertible_v<const T&, basic_string_view<charT, traits>> istrue and
- is_convertible_v<const T&, const charT*> isfalse.
Effects: Let G be the name of the function.
Equivalent to:basic_string_view<charT, traits> s = *this, sv = t;return s.G(sv, pos);
Remarks: The exception specification is equivalent tois_nothrow_convertible_v<const T&, basic_string_view<charT, traits>>.