|
4020 | 4020 | constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default;
|
4021 | 4021 | constexpr basic_string_view(const charT* str);
|
4022 | 4022 | constexpr basic_string_view(const charT* str, size_type len);
|
| 4023 | + template<class It, class End> |
| 4024 | + constexpr basic_string_view(It begin, End end); |
4023 | 4025 |
|
4024 | 4026 | // \ref{string.view.iterators}, iterator support
|
4025 | 4027 | constexpr const_iterator begin() const noexcept;
|
|
4106 | 4108 | const_pointer data_; // \expos
|
4107 | 4109 | size_type size_; // \expos
|
4108 | 4110 | };
|
| 4111 | + |
| 4112 | +// \ref{string.view.deduct}, deduction guide |
| 4113 | +template<class It, class End> |
| 4114 | + basic_string_view(It, End) -> basic_string_view<iter_value_t<It>>; |
4109 | 4115 | \end{codeblock}
|
4110 | 4116 |
|
4111 | 4117 | \pnum
|
|
4174 | 4180 | and initializing \tcode{size_} with \tcode{len}.
|
4175 | 4181 | \end{itemdescr}
|
4176 | 4182 |
|
| 4183 | +\indexlibraryctor{basic_string_view}% |
| 4184 | +\begin{itemdecl} |
| 4185 | +template<class It, class End> |
| 4186 | + constexpr basic_string_view(It begin, End end); |
| 4187 | +\end{itemdecl} |
| 4188 | + |
| 4189 | +\begin{itemdescr} |
| 4190 | +\pnum |
| 4191 | +\constraints |
| 4192 | +\begin{itemize} |
| 4193 | +\item \tcode{It} satisfies \libconcept{contiguous_iterator}. |
| 4194 | +\item \tcode{End} satisfies \tcode{\libconcept{sized_sentinel_for}<It>}. |
| 4195 | +\item \tcode{is_same_v<iter_value_t<It>, charT>} is \tcode{true}. |
| 4196 | +\item \tcode{is_convertible_v<End, size_type>} is \tcode{false}. |
| 4197 | +\end{itemize} |
| 4198 | + |
| 4199 | +\pnum |
| 4200 | +\expects |
| 4201 | +\begin{itemize} |
| 4202 | +\item \range{begin}{end} is a valid range. |
| 4203 | +\item \tcode{It} models \libconcept{contiguous_iterator}. |
| 4204 | +\item \tcode{End} models \tcode{\libconcept{sized_sentinel_for}<It>}. |
| 4205 | +\end{itemize} |
| 4206 | + |
| 4207 | +\pnum |
| 4208 | +\effects |
| 4209 | +Initializes \tcode{data_} with \tcode{to_address(begin)} and |
| 4210 | +initializes \tcode{size_} with \tcode{end - begin}. |
| 4211 | +\end{itemdescr} |
| 4212 | + |
4177 | 4213 | \rSec3[string.view.iterators]{Iterator support}
|
4178 | 4214 |
|
4179 | 4215 | \indexlibrarymember{const_iterator}{basic_string_view}%
|
|
4836 | 4872 | Otherwise, returns \tcode{npos}.
|
4837 | 4873 | \end{itemdescr}
|
4838 | 4874 |
|
| 4875 | +\rSec2[string.view.deduct]{Deduction guide} |
| 4876 | + |
| 4877 | +\begin{itemdecl} |
| 4878 | +template<class It, class End> |
| 4879 | + basic_string_view(It, End) -> basic_string_view<iter_value_t<It>>; |
| 4880 | +\end{itemdecl} |
| 4881 | + |
| 4882 | +\begin{itemdescr} |
| 4883 | +\pnum |
| 4884 | +\constraints |
| 4885 | +\begin{itemize} |
| 4886 | +\item \tcode{It} satisfies \libconcept{contiguous_iterator}. |
| 4887 | +\item \tcode{End} satisfies \tcode{\libconcept{sized_sentinel_for}<It>}. |
| 4888 | +\end{itemize} |
| 4889 | +\end{itemdescr} |
| 4890 | + |
4839 | 4891 | \rSec2[string.view.comparison]{Non-member comparison functions}
|
4840 | 4892 |
|
4841 | 4893 | \pnum
|
|
0 commit comments