Skip to content

Commit 428d053

Browse files
author
Dawn Perchik
committed
LWG2583 There is no way to supply an allocator for basic_string(str, pos)
1 parent 17baf73 commit 428d053

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

source/strings.tex

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,9 @@
895895
explicit basic_string(const Allocator& a) noexcept;
896896
basic_string(const basic_string& str);
897897
basic_string(basic_string&& str) noexcept;
898-
basic_string(const basic_string& str, size_type pos, size_type n = npos,
898+
basic_string(const basic_string& str, size_type pos,
899+
const Allocator& a = Allocator());
900+
basic_string(const basic_string& str, size_type pos, size_type n,
899901
const Allocator& a = Allocator());
900902
basic_string(const charT* s,
901903
size_type n, const Allocator& a = Allocator());
@@ -1181,8 +1183,7 @@
11811183

11821184
\indexlibrary{\idxcode{basic_string}!constructor}%
11831185
\begin{itemdecl}
1184-
basic_string(const basic_string& str,
1185-
size_type pos, size_type n = npos,
1186+
basic_string(const basic_string& str, size_type pos,
11861187
const Allocator& a = Allocator());
11871188
\end{itemdecl}
11881189

@@ -1198,12 +1199,31 @@
11981199
Constructs an object of class
11991200
\tcode{basic_string}
12001201
and determines the effective length \tcode{rlen} of the initial string
1201-
value as the smaller of \tcode{n} and
1202-
\tcode{str.size() - pos},
1202+
value as \tcode{str.size() - pos},
1203+
as indicated in Table~\ref{tab:strings.ctr.2}.
1204+
\end{itemdescr}
1205+
1206+
\indexlibrary{\idxcode{basic_string}!constructor}%
1207+
\begin{itemdecl}
1208+
basic_string(const basic_string& str, size_type pos, size_type n,
1209+
const Allocator& a = Allocator());
1210+
\end{itemdecl}
1211+
1212+
\begin{itemdescr}
1213+
\pnum
1214+
\throws
1215+
\tcode{out_of_range} if \tcode{pos > str.size()}.
1216+
1217+
\pnum
1218+
\effects
1219+
Constructs an object of class \tcode{basic_string}
1220+
and determines the effective length \tcode{rlen} of the initial string
1221+
value as the smaller of \tcode{n} and \tcode{str.size() - pos},
12031222
as indicated in Table~\ref{tab:strings.ctr.2}.
12041223

12051224
\begin{libefftabvalue}
1206-
{\tcode{basic_string(const basic_string\&, size_type, size_type, const Allocator\&)} effects}
1225+
{\tcode{basic_string(const basic_string\&, size_type, const Allocator\&)}\protect\linebreak and
1226+
\tcode{basic_string(const basic_string\&, size_type, size_type, const Allocator\&)} effects}
12071227
{tab:strings.ctr.2}
12081228
\tcode{data()} &
12091229
points at the first element of an allocated copy of \tcode{rlen} consecutive elements

0 commit comments

Comments
 (0)