From Jason Turner

[deque.capacity]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpxua_ms84/{from.md → to.md} +15 -13
tmp/tmpxua_ms84/{from.md → to.md} RENAMED
@@ -1,44 +1,46 @@
1
- #### `deque` capacity <a id="deque.capacity">[[deque.capacity]]</a>
2
 
3
  ``` cpp
4
  void resize(size_type sz);
5
  ```
6
 
 
 
 
7
  *Effects:* If `sz < size()`, erases the last `size() - sz` elements from
8
  the sequence. Otherwise, appends `sz - size()` default-inserted elements
9
  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()`, erases the last `size() - sz` elements from
19
  the sequence. Otherwise, appends `sz - size()` copies of `c` to the
20
  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
  *Effects:* `shrink_to_fit` is a non-binding request to reduce memory use
31
  but does not change the size of the sequence.
32
 
33
  [*Note 1*: The request is non-binding to allow latitude for
34
  implementation-specific optimizations. — *end note*]
35
 
36
- If an exception is thrown other than by the move constructor of a
37
- non-`CopyInsertable` `T` there are no effects.
 
38
 
39
- *Complexity:* Linear in the size of the sequence.
 
40
 
41
- *Remarks:* `shrink_to_fit` invalidates all the references, pointers, and
42
- iterators referring to the elements in the sequence as well as the
43
- past-the-end iterator.
44
 
 
1
+ #### Capacity <a id="deque.capacity">[[deque.capacity]]</a>
2
 
3
  ``` cpp
4
  void resize(size_type sz);
5
  ```
6
 
7
+ *Preconditions:* `T` is *Cpp17MoveInsertable* and
8
+ *Cpp17DefaultInsertable* into `*this`.
9
+
10
  *Effects:* If `sz < size()`, erases the last `size() - sz` elements from
11
  the sequence. Otherwise, appends `sz - size()` default-inserted elements
12
  to the sequence.
13
 
 
 
 
14
  ``` cpp
15
  void resize(size_type sz, const T& c);
16
  ```
17
 
18
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `*this`.
19
+
20
  *Effects:* If `sz < size()`, erases the last `size() - sz` elements from
21
  the sequence. Otherwise, appends `sz - size()` copies of `c` to the
22
  sequence.
23
 
 
 
24
  ``` cpp
25
  void shrink_to_fit();
26
  ```
27
 
28
+ *Preconditions:* `T` is *Cpp17MoveInsertable* into `*this`.
29
 
30
  *Effects:* `shrink_to_fit` is a non-binding request to reduce memory use
31
  but does not change the size of the sequence.
32
 
33
  [*Note 1*: The request is non-binding to allow latitude for
34
  implementation-specific optimizations. — *end note*]
35
 
36
+ If the size is equal to the old capacity, or if an exception is thrown
37
+ other than by the move constructor of a non-*Cpp17CopyInsertable* `T`,
38
+ then there are no effects.
39
 
40
+ *Complexity:* If the size is not equal to the old capacity, linear in
41
+ the size of the sequence; otherwise constant.
42
 
43
+ *Remarks:* If the size is not equal to the old capacity, then
44
+ invalidates all the references, pointers, and iterators referring to the
45
+ elements in the sequence, as well as the past-the-end iterator.
46