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