Skip to content

Commit 76b346d

Browse files
committed
Merge 2018-03 LWG Motion 12
2 parents d10b3c4 + f9e8e9f commit 76b346d

File tree

2 files changed

+40
-20
lines changed

2 files changed

+40
-20
lines changed

source/future.tex

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,36 @@
25502550
The weak form may fail spuriously. See~\ref{atomics.types.operations}.
25512551
\end{itemdescr}
25522552

2553+
\rSec1[depr.string.capacity]{Deprecated \tcode{basic_string} capacity}
2554+
2555+
\pnum
2556+
The following member is declared in addition to those members specified
2557+
in \ref{string.capacity}:
2558+
2559+
\indexlibrary{\idxcode{basic_string}}%
2560+
\begin{codeblock}
2561+
namespace std {
2562+
template<class charT, class traits = char_traits<charT>,
2563+
class Allocator = allocator<charT>>
2564+
class basic_string {
2565+
public:
2566+
void reserve();
2567+
};
2568+
}
2569+
\end{codeblock}
2570+
2571+
\indexlibrarymember{reserve}{basic_string}%
2572+
\begin{itemdecl}
2573+
void reserve();
2574+
\end{itemdecl}
2575+
2576+
\begin{itemdescr}
2577+
\pnum\effects
2578+
After this call, \tcode{capacity()} has an unspecified value
2579+
greater than or equal to \tcode{size()}.
2580+
\begin{note} This is a non-binding shrink to fit request. \end{note}
2581+
\end{itemdescr}
2582+
25532583
\rSec1[depr.locale.stdcvt]{Deprecated standard code conversion facets}
25542584

25552585
\pnum

source/strings.tex

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@
969969
void resize(size_type n, charT c);
970970
void resize(size_type n);
971971
size_type capacity() const noexcept;
972-
void reserve(size_type res_arg = 0);
972+
void reserve(size_type res_arg);
973973
void shrink_to_fit();
974974
void clear() noexcept;
975975
[[nodiscard]] bool empty() const noexcept;
@@ -1771,35 +1771,25 @@
17711771

17721772
\indexlibrarymember{reserve}{basic_string}%
17731773
\begin{itemdecl}
1774-
void reserve(size_type res_arg=0);
1774+
void reserve(size_type res_arg);
17751775
\end{itemdecl}
17761776

17771777
\begin{itemdescr}
1778-
\pnum
1779-
The member function
1780-
\tcode{reserve()}
1781-
is a directive that informs a
1782-
\tcode{basic_string}
1783-
object of a planned change in size,
1784-
so that it can manage the storage allocation accordingly.
1785-
17861778
\pnum
17871779
\effects
1780+
A directive that informs a \tcode{basic_string} of a planned change in size,
1781+
so that the storage allocation can be managed accordingly.
17881782
After
17891783
\tcode{reserve()},
17901784
\tcode{capacity()}
17911785
is greater or equal to the argument of
1792-
\tcode{reserve}.
1793-
\begin{note}
1794-
Calling
1795-
\tcode{reserve()}
1796-
with a \tcode{res_arg} argument less than
1786+
\tcode{reserve}
1787+
if reallocation happens; and
1788+
equal to the previous value of
17971789
\tcode{capacity()}
1798-
is in effect a non-binding shrink request.
1799-
A call with
1800-
\tcode{res_arg <= size()}
1801-
is in effect a non-binding shrink-to-fit request.
1802-
\end{note}
1790+
otherwise.
1791+
Reallocation happens at this point if and only if
1792+
the current capacity is less than the argument of \tcode{reserve()}.
18031793

18041794
\pnum
18051795
\throws

0 commit comments

Comments
 (0)