Skip to content

Commit c537fa0

Browse files
jensmaurertkoeppe
authored andcommitted
P3044R2 sub-string_view from string
1 parent 4b4d2e5 commit c537fa0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

source/strings.tex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,8 @@
678678

679679
constexpr basic_string_view substr(size_type pos = 0,
680680
size_type n = npos) const; // freestanding-deleted
681+
constexpr basic_string_view subview(size_type pos = 0,
682+
size_type n = npos) const; // freestanding-deleted
681683

682684
constexpr int compare(basic_string_view s) const noexcept;
683685
constexpr int compare(size_type pos1, size_type n1,
@@ -1200,8 +1202,10 @@
12001202
\end{itemdescr}
12011203

12021204
\indexlibrarymember{substr}{basic_string_view}%
1205+
\indexlibrarymember{subview}{basic_string_view}%
12031206
\begin{itemdecl}
12041207
constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
1208+
constexpr basic_string_view subview(size_type pos = 0, size_type n = npos) const;
12051209
\end{itemdecl}
12061210

12071211
\begin{itemdescr}
@@ -2285,6 +2289,8 @@
22852289

22862290
constexpr basic_string substr(size_type pos = 0, size_type n = npos) const &;
22872291
constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&;
2292+
constexpr basic_string_view<charT, traits> subview(size_type pos = 0,
2293+
size_type n = npos) const;
22882294

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

4479+
\indexlibrarymember{subview}{basic_string}%
4480+
\begin{itemdecl}
4481+
constexpr basic_string_view<charT, traits> subview(size_type pos = 0, size_type n = npos) const;
4482+
\end{itemdecl}
4483+
4484+
\begin{itemdescr}
4485+
\pnum
4486+
\effects
4487+
Equivalent to: \tcode{return basic_string_view<charT, traits>(*this).subview(pos, n);}
4488+
\end{itemdescr}
4489+
44734490
\rSec4[string.compare]{\tcode{basic_string::compare}}
44744491

44754492
\indexlibrarymember{compare}{basic_string}%

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@
837837
#define @\defnlibxname{cpp_lib_stdatomic_h}@ 202011L // also in \libheader{stdatomic.h}
838838
#define @\defnlibxname{cpp_lib_string_contains}@ 202011L // also in \libheader{string}, \libheader{string_view}
839839
#define @\defnlibxname{cpp_lib_string_resize_and_overwrite}@ 202110L // also in \libheader{string}
840+
#define @\defnlibxname{cpp_lib_string_subview}@ 202506L // also in \libheader{string}, \libheader{string_view}
840841
#define @\defnlibxname{cpp_lib_string_udls}@ 201304L // also in \libheader{string}
841842
#define @\defnlibxname{cpp_lib_string_view}@ 202403L // also in \libheader{string}, \libheader{string_view}
842843
#define @\defnlibxname{cpp_lib_submdspan}@ 202411L // freestanding, also in \libheader{mdspan}

0 commit comments

Comments
 (0)