|
4091 | 4091 | constexpr basic_string_view(const charT* str, size_type len);
|
4092 | 4092 | template<class It, class End>
|
4093 | 4093 | constexpr basic_string_view(It begin, End end);
|
| 4094 | + template<class R> |
| 4095 | + constexpr basic_string_view(R&& r); |
4094 | 4096 |
|
4095 | 4097 | // \ref{string.view.iterators}, iterator support
|
4096 | 4098 | constexpr const_iterator begin() const noexcept;
|
|
4179 | 4181 | size_type size_; // \expos
|
4180 | 4182 | };
|
4181 | 4183 |
|
4182 |
| - // \ref{string.view.deduct}, deduction guide |
| 4184 | + // \ref{string.view.deduct}, deduction guides |
4183 | 4185 | template<class It, class End>
|
4184 | 4186 | basic_string_view(It, End) -> basic_string_view<iter_value_t<It>>;
|
| 4187 | + template<class R> |
| 4188 | + basic_string_view(R&&) -> basic_string_view<ranges::range_value_t<R>>; |
4185 | 4189 | }
|
4186 | 4190 | \end{codeblock}
|
4187 | 4191 |
|
|
4281 | 4285 | initializes \tcode{size_} with \tcode{end - begin}.
|
4282 | 4286 | \end{itemdescr}
|
4283 | 4287 |
|
| 4288 | +\indexlibraryctor{basic_string_view}% |
| 4289 | +\begin{itemdecl} |
| 4290 | +template<class R> |
| 4291 | + constexpr basic_string_view(R&& r); |
| 4292 | +\end{itemdecl} |
| 4293 | + |
| 4294 | +\begin{itemdescr} |
| 4295 | +\pnum |
| 4296 | +Let \tcode{d} be an lvalue of type \tcode{remove_cvref_t<R>}. |
| 4297 | + |
| 4298 | +\pnum |
| 4299 | +\constraints |
| 4300 | +\begin{itemize} |
| 4301 | +\item |
| 4302 | +\tcode{R} models |
| 4303 | +\tcode{ranges::\libconcept{contiguous_range}} and \tcode{ranges::\libconcept{sized_range}}, |
| 4304 | +\item |
| 4305 | +\tcode{is_same_v<ranges::range_value_t<R>, charT>} is \tcode{true}, |
| 4306 | +\item |
| 4307 | +\tcode{is_convertible_v<R, const charT*>} is \tcode{false}, |
| 4308 | +\item |
| 4309 | +\tcode{d.operator ::std::basic_string_view<charT, traits>()} |
| 4310 | +is not a valid expression, and |
| 4311 | +\item |
| 4312 | +if the \grammarterm{qualified-id} \tcode{R::traits_type} is valid and denotes a type, |
| 4313 | +\tcode{is_same_v<remove_reference_t<R>::traits_type, traits>} is \tcode{true}. |
| 4314 | +\end{itemize} |
| 4315 | + |
| 4316 | +\pnum |
| 4317 | +\effects |
| 4318 | +Initializes \tcode{data_} with \tcode{ranges::data(r)} and |
| 4319 | +\tcode{size_} with \tcode{ranges::size(r)}. |
| 4320 | + |
| 4321 | +\pnum |
| 4322 | +\throws |
| 4323 | +Any exception thrown by \tcode{ranges::data(r)} and \tcode{ranges::size(r)}. |
| 4324 | +\end{itemdescr} |
| 4325 | + |
4284 | 4326 | \rSec3[string.view.iterators]{Iterator support}
|
4285 | 4327 |
|
4286 | 4328 | \indexlibrarymember{const_iterator}{basic_string_view}%
|
|
4956 | 4998 | Otherwise, returns \tcode{npos}.
|
4957 | 4999 | \end{itemdescr}
|
4958 | 5000 |
|
4959 |
| -\rSec2[string.view.deduct]{Deduction guide} |
| 5001 | +\rSec2[string.view.deduct]{Deduction guides} |
4960 | 5002 |
|
4961 | 5003 | \begin{itemdecl}
|
4962 | 5004 | template<class It, class End>
|
|
4972 | 5014 | \end{itemize}
|
4973 | 5015 | \end{itemdescr}
|
4974 | 5016 |
|
| 5017 | +\begin{itemdecl} |
| 5018 | +template<class R> |
| 5019 | + basic_string_view(R&&) -> basic_string_view<ranges::range_value_t<R>>; |
| 5020 | +\end{itemdecl} |
| 5021 | + |
| 5022 | +\begin{itemdescr} |
| 5023 | +\pnum |
| 5024 | +\constraints |
| 5025 | +\tcode{R} satisfies \tcode{ranges::\libconcept{contiguous_range}}. |
| 5026 | +\end{itemdescr} |
| 5027 | + |
4975 | 5028 | \rSec2[string.view.comparison]{Non-member comparison functions}
|
4976 | 5029 |
|
4977 | 5030 | \pnum
|
|
0 commit comments