|
1046 | 1046 | constexpr bool ends_with(basic_string_view<charT, traits> x) const noexcept;
|
1047 | 1047 | constexpr bool ends_with(charT x) const noexcept;
|
1048 | 1048 | constexpr bool ends_with(const charT* x) const;
|
| 1049 | + |
| 1050 | + constexpr bool contains(basic_string_view<charT, traits> x) const noexcept; |
| 1051 | + constexpr bool contains(charT x) const noexcept; |
| 1052 | + constexpr bool contains(const charT* x) const; |
1049 | 1053 | };
|
1050 | 1054 |
|
1051 | 1055 | template<class InputIterator,
|
|
3222 | 3226 | \end{codeblock}
|
3223 | 3227 | \end{itemdescr}
|
3224 | 3228 |
|
| 3229 | +\rSec4[string.contains]{\tcode{basic_string::contains}} |
| 3230 | + |
| 3231 | +\indexlibrarymember{contains}{basic_string}% |
| 3232 | +\begin{itemdecl} |
| 3233 | +constexpr bool contains(basic_string_view<charT, traits> x) const noexcept; |
| 3234 | +constexpr bool contains(charT x) const noexcept; |
| 3235 | +constexpr bool contains(const charT* x) const; |
| 3236 | +\end{itemdecl} |
| 3237 | + |
| 3238 | +\begin{itemdescr} |
| 3239 | +\pnum |
| 3240 | +\effects |
| 3241 | +Equivalent to: |
| 3242 | +\begin{codeblock} |
| 3243 | +return basic_string_view<charT, traits>(data(), size()).contains(x); |
| 3244 | +\end{codeblock} |
| 3245 | +\end{itemdescr} |
| 3246 | + |
3225 | 3247 | \rSec2[string.nonmembers]{Non-member functions}
|
3226 | 3248 |
|
3227 | 3249 | \indexlibraryglobal{basic_string}
|
|
4117 | 4139 | constexpr bool ends_with(charT x) const noexcept;
|
4118 | 4140 | constexpr bool ends_with(const charT* x) const;
|
4119 | 4141 |
|
| 4142 | + constexpr bool contains(basic_string_view x) const noexcept; |
| 4143 | + constexpr bool contains(charT x) const noexcept; |
| 4144 | + constexpr bool contains(const charT* x) const; |
| 4145 | + |
4120 | 4146 | // \ref{string.view.find}, searching
|
4121 | 4147 | constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
|
4122 | 4148 | constexpr size_type find(charT c, size_type pos = 0) const noexcept;
|
|
4717 | 4743 | Equivalent to: \tcode{return ends_with(basic_string_view(x));}
|
4718 | 4744 | \end{itemdescr}
|
4719 | 4745 |
|
| 4746 | +\indexlibrarymember{contains}{basic_string_view}% |
| 4747 | +\begin{itemdecl} |
| 4748 | +constexpr bool contains(basic_string_view x) const noexcept; |
| 4749 | +constexpr bool contains(charT x) const noexcept; |
| 4750 | +constexpr bool contains(const charT* x) const; |
| 4751 | +\end{itemdecl} |
| 4752 | + |
| 4753 | +\begin{itemdescr} |
| 4754 | +\pnum |
| 4755 | +\effects |
| 4756 | +Equivalent to: \tcode{return find(x) != npos;} |
| 4757 | +\end{itemdescr} |
| 4758 | + |
4720 | 4759 | \rSec3[string.view.find]{Searching}
|
4721 | 4760 |
|
4722 | 4761 | \pnum
|
|
0 commit comments