File tree Expand file tree Collapse file tree 3 files changed +15
-33
lines changed Expand file tree Collapse file tree 3 files changed +15
-33
lines changed Original file line number Diff line number Diff line change 129
129
// OK in \CppXXVI {}
130
130
\end {codeblock }
131
131
132
+ \nodiffref
133
+ \change
134
+ Remove the \tcode {basic_string::reserve()} overload with no parameters.
135
+ \rationale
136
+ The overload of \tcode {reserve} with no parameters is redundant.
137
+ The \tcode {shrink_to_fit} member function can be used instead.
138
+ \effect
139
+ A valid \CppXXIII {} program that calls \tcode {reserve()}
140
+ on a \tcode {basic_string} object may fail to compile.
141
+ The old functionality can be achieved by calling \tcode {shrink_to_fit()} instead,
142
+ or the function call can be safely eliminated with no side effects.
143
+
132
144
\rSec 2[diff.cpp23.containers]{\ref {containers }: containers library}
133
145
134
146
\diffref {span.overview }
Original file line number Diff line number Diff line change 1995
1995
The weak form may fail spuriously. See~\ref {atomics.types.operations }.
1996
1996
\end {itemdescr }
1997
1997
1998
- \rSec 1[depr.string.capacity]{Deprecated \tcode {basic_string} capacity}
1999
-
2000
- \pnum
2001
- The following member is declared in addition to those members specified
2002
- in \ref {string.capacity }:
2003
-
2004
- \indexlibraryglobal {basic_string}%
2005
- \begin {codeblock }
2006
- namespace std {
2007
- template<class charT, class traits = char_traits<charT>,
2008
- class Allocator = allocator<charT>>
2009
- class basic_string {
2010
- public:
2011
- void reserve();
2012
- };
2013
- }
2014
- \end {codeblock }
2015
-
2016
- \indexlibrarymember {reserve}{basic_string}%
2017
- \begin {itemdecl }
2018
- void reserve();
2019
- \end {itemdecl }
2020
-
2021
- \begin {itemdescr }
2022
- \pnum
2023
- \effects
2024
- After this call, \tcode {capacity()} has an unspecified value
2025
- greater than or equal to \tcode {size()}.
2026
- \begin {note }
2027
- This is a non-binding shrink to fit request.
2028
- \end {note }
2029
- \end {itemdescr }
2030
-
2031
1998
\rSec 1[depr.format]{Deprecated formatting}
2032
1999
2033
2000
\rSec 2[depr.format.syn]{Header \tcode {<format>} synopsis}
Original file line number Diff line number Diff line change 28
28
% P2874R2 Mandating Annex D
29
29
\removedxref {depr.res.on.required }
30
30
31
+ % P2870R3 Remove `basic_string::reserve()` with no parameters
32
+ \removedxref {depr.string.capacity }
33
+
31
34
% %% Renamed sections.
32
35
% %% Examples:
33
36
%
You can’t perform that action at this time.
0 commit comments