diff --git a/source/strings.tex b/source/strings.tex index 14bea900d3..91a59f4491 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -4091,6 +4091,8 @@ constexpr basic_string_view(const charT* str, size_type len); template constexpr basic_string_view(It begin, End end); + template + constexpr basic_string_view(R&& r); // \ref{string.view.iterators}, iterator support constexpr const_iterator begin() const noexcept; @@ -4179,9 +4181,11 @@ size_type size_; // \expos }; - // \ref{string.view.deduct}, deduction guide + // \ref{string.view.deduct}, deduction guides template basic_string_view(It, End) -> basic_string_view>; + template + basic_string_view(R&&) -> basic_string_view>; } \end{codeblock} @@ -4281,6 +4285,45 @@ initializes \tcode{size_} with \tcode{end - begin}. \end{itemdescr} +\indexlibraryctor{basic_string_view}% +\begin{itemdecl} +template + constexpr basic_string_view(R&& r); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{d} be an lvalue of type \tcode{remove_cvref_t}. + +\pnum +\constraints +\begin{itemize} +\item +\tcode{R} models +\tcode{ranges::\libconcept{contiguous_range}} and \tcode{ranges::\libconcept{sized_range}}, +\item +\tcode{is_same_v, charT>} is \tcode{true}, +\item +\tcode{is_convertible_v} is \tcode{false}, +\item +\tcode{d.operator ::std::basic_string_view()} +is not a valid expression, and +\item +if the \grammarterm{qualified-id} \tcode{remove_reference_t::traits_type} +is valid and denotes a type, +\tcode{is_same_v::traits_type, traits>} is \tcode{true}. +\end{itemize} + +\pnum +\effects +Initializes \tcode{data_} with \tcode{ranges::data(r)} and +\tcode{size_} with \tcode{ranges::size(r)}. + +\pnum +\throws +Any exception thrown by \tcode{ranges::data(r)} and \tcode{ranges::size(r)}. +\end{itemdescr} + \rSec3[string.view.iterators]{Iterator support} \indexlibrarymember{const_iterator}{basic_string_view}% @@ -4956,7 +4999,7 @@ Otherwise, returns \tcode{npos}. \end{itemdescr} -\rSec2[string.view.deduct]{Deduction guide} +\rSec2[string.view.deduct]{Deduction guides} \begin{itemdecl} template @@ -4972,6 +5015,17 @@ \end{itemize} \end{itemdescr} +\begin{itemdecl} +template + basic_string_view(R&&) -> basic_string_view>; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\constraints +\tcode{R} satisfies \tcode{ranges::\libconcept{contiguous_range}}. +\end{itemdescr} + \rSec2[string.view.comparison]{Non-member comparison functions} \pnum