From Jason Turner

[deque.capacity]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpabgi2qws/{from.md → to.md} +15 -17
tmp/tmpabgi2qws/{from.md → to.md} RENAMED
@@ -2,36 +2,34 @@
2
 
3
  ``` cpp
4
  void resize(size_type sz);
5
  ```
6
 
7
- *Effects:* If `sz <= size()`, equivalent to
8
- `erase(begin() + sz, end());`. If `size() < sz`, appends `sz - size()`
9
- value-initialized elements to the sequence.
10
 
11
- *Requires:* `T` shall be `DefaultConstructible`.
 
12
 
13
  ``` cpp
14
  void resize(size_type sz, const T& c);
15
  ```
16
 
17
- *Effects:*
18
-
19
- ``` cpp
20
- if (sz > size())
21
- insert(end(), sz-size(), c);
22
- else if (sz < size())
23
- erase(begin()+sz, end());
24
- else
25
- ; // do nothing
26
- ```
27
 
28
  *Requires:* `T` shall be `CopyInsertable` into `*this`.
29
 
30
  ``` cpp
31
  void shrink_to_fit();
32
  ```
33
 
34
- *Remarks:* `shrink_to_fit` is a non-binding request to reduce memory
35
- use. The request is non-binding to allow latitude for
36
- implementation-specific optimizations.
 
 
 
 
37
 
 
2
 
3
  ``` cpp
4
  void resize(size_type sz);
5
  ```
6
 
7
+ *Effects:* If `sz <= size()`, equivalent to calling `pop_back()`
8
+ `size() - sz` times. If `size() < sz`, appends `sz - size()`
9
+ default-inserted elements to the sequence.
10
 
11
+ *Requires:* `T` shall be `MoveInsertable` and `DefaultInsertable` into
12
+ `*this`.
13
 
14
  ``` cpp
15
  void resize(size_type sz, const T& c);
16
  ```
17
 
18
+ *Effects:* If `sz <= size()`, equivalent to calling `pop_back()`
19
+ `size() - sz` times. If `size() < sz`, appends `sz - size()` copies of
20
+ `c` to the sequence.
 
 
 
 
 
 
 
21
 
22
  *Requires:* `T` shall be `CopyInsertable` into `*this`.
23
 
24
  ``` cpp
25
  void shrink_to_fit();
26
  ```
27
 
28
+ *Requires:* `T` shall be `MoveInsertable` into `*this`.
29
+
30
+ *Complexity:* Linear in the size of the sequence.
31
+
32
+ *Remarks:* `shrink_to_fit` is a non-binding request to reduce memory use
33
+ but does not change the size of the sequence. The request is non-binding
34
+ to allow latitude for implementation-specific optimizations.
35