Skip to content

Commit

Permalink
P2870R3 Remove deprecated basic_string::reserve() with no parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisdairM authored and tkoeppe committed Dec 17, 2023
1 parent 58c6c79 commit 9ad2e1a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 33 deletions.
12 changes: 12 additions & 0 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@
// OK in \CppXXVI{}
\end{codeblock}

\nodiffref
\change
Remove the \tcode{basic_string::reserve()} overload with no parameters.
\rationale
The overload of \tcode{reserve} with no parameters is redundant.
The \tcode{shrink_to_fit} member function can be used instead.
\effect
A valid \CppXXIII{} program that calls \tcode{reserve()}
on a \tcode{basic_string} object may fail to compile.
The old functionality can be achieved by calling \tcode{shrink_to_fit()} instead,
or the function call can be safely eliminated with no side effects.

\rSec2[diff.cpp23.containers]{\ref{containers}: containers library}

\diffref{span.overview}
Expand Down
33 changes: 0 additions & 33 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1995,39 +1995,6 @@
The weak form may fail spuriously. See~\ref{atomics.types.operations}.
\end{itemdescr}

\rSec1[depr.string.capacity]{Deprecated \tcode{basic_string} capacity}

\pnum
The following member is declared in addition to those members specified
in \ref{string.capacity}:

\indexlibraryglobal{basic_string}%
\begin{codeblock}
namespace std {
template<class charT, class traits = char_traits<charT>,
class Allocator = allocator<charT>>
class basic_string {
public:
void reserve();
};
}
\end{codeblock}

\indexlibrarymember{reserve}{basic_string}%
\begin{itemdecl}
void reserve();
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
After this call, \tcode{capacity()} has an unspecified value
greater than or equal to \tcode{size()}.
\begin{note}
This is a non-binding shrink to fit request.
\end{note}
\end{itemdescr}

\rSec1[depr.format]{Deprecated formatting}

\rSec2[depr.format.syn]{Header \tcode{<format>} synopsis}
Expand Down
3 changes: 3 additions & 0 deletions source/xrefdelta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
% P2874R2 Mandating Annex D
\removedxref{depr.res.on.required}

% P2870R3 Remove `basic_string::reserve()` with no parameters
\removedxref{depr.string.capacity}

%%% Renamed sections.
%%% Examples:
%
Expand Down

0 comments on commit 9ad2e1a

Please sign in to comment.