File tree Expand file tree Collapse file tree 2 files changed +40
-20
lines changed Expand file tree Collapse file tree 2 files changed +40
-20
lines changed Original file line number Diff line number Diff line change 2550
2550
The weak form may fail spuriously. See~\ref {atomics.types.operations }.
2551
2551
\end {itemdescr }
2552
2552
2553
+ \rSec 1[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
+
2553
2583
\rSec 1[depr.locale.stdcvt]{Deprecated standard code conversion facets}
2554
2584
2555
2585
\pnum
Original file line number Diff line number Diff line change 969
969
void resize(size_type n, charT c);
970
970
void resize(size_type n);
971
971
size_type capacity() const noexcept;
972
- void reserve(size_type res_arg = 0 );
972
+ void reserve(size_type res_arg);
973
973
void shrink_to_fit();
974
974
void clear() noexcept;
975
975
[[nodiscard]] bool empty() const noexcept;
1771
1771
1772
1772
\indexlibrarymember {reserve}{basic_string}%
1773
1773
\begin {itemdecl }
1774
- void reserve(size_type res_arg=0 );
1774
+ void reserve(size_type res_arg);
1775
1775
\end {itemdecl }
1776
1776
1777
1777
\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
-
1786
1778
\pnum
1787
1779
\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.
1788
1782
After
1789
1783
\tcode {reserve()},
1790
1784
\tcode {capacity()}
1791
1785
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
1797
1789
\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()}.
1803
1793
1804
1794
\pnum
1805
1795
\throws
You can’t perform that action at this time.
0 commit comments