Skip to content

P3044R2 sub-string_view from string #7975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@

constexpr basic_string_view substr(size_type pos = 0,
size_type n = npos) const; // freestanding-deleted
constexpr basic_string_view subview(size_type pos = 0,
size_type n = npos) const; // freestanding-deleted

constexpr int compare(basic_string_view s) const noexcept;
constexpr int compare(size_type pos1, size_type n1,
Expand Down Expand Up @@ -1200,8 +1202,10 @@
\end{itemdescr}

\indexlibrarymember{substr}{basic_string_view}%
\indexlibrarymember{subview}{basic_string_view}%
\begin{itemdecl}
constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
constexpr basic_string_view subview(size_type pos = 0, size_type n = npos) const;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -2285,6 +2289,8 @@

constexpr basic_string substr(size_type pos = 0, size_type n = npos) const &;
constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&;
constexpr basic_string_view<charT, traits> subview(size_type pos = 0,
size_type n = npos) const;

template<class T>
constexpr int compare(const T& t) const noexcept(@\seebelow@);
Expand Down Expand Up @@ -4470,6 +4476,17 @@
Equivalent to: \tcode{return basic_string(std::move(*this), pos, n);}
\end{itemdescr}

\indexlibrarymember{subview}{basic_string}%
\begin{itemdecl}
constexpr basic_string_view<charT, traits> subview(size_type pos = 0, size_type n = npos) const;
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
Equivalent to: \tcode{return basic_string_view<charT, traits>(*this).subview(pos, n);}
\end{itemdescr}

\rSec4[string.compare]{\tcode{basic_string::compare}}

\indexlibrarymember{compare}{basic_string}%
Expand Down
1 change: 1 addition & 0 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@
#define @\defnlibxname{cpp_lib_stdatomic_h}@ 202011L // also in \libheader{stdatomic.h}
#define @\defnlibxname{cpp_lib_string_contains}@ 202011L // also in \libheader{string}, \libheader{string_view}
#define @\defnlibxname{cpp_lib_string_resize_and_overwrite}@ 202110L // also in \libheader{string}
#define @\defnlibxname{cpp_lib_string_subview}@ 202506L // also in \libheader{string}, \libheader{string_view}
#define @\defnlibxname{cpp_lib_string_udls}@ 201304L // also in \libheader{string}
#define @\defnlibxname{cpp_lib_string_view}@ 202403L // also in \libheader{string}, \libheader{string_view}
#define @\defnlibxname{cpp_lib_submdspan}@ 202411L // freestanding, also in \libheader{mdspan}
Expand Down