tmp/tmpt_5z8wnn/{from.md → to.md}
RENAMED
|
@@ -2,34 +2,43 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
void resize(size_type sz);
|
| 5 |
```
|
| 6 |
|
| 7 |
-
*Effects:* If `sz <
|
| 8 |
-
|
| 9 |
-
|
| 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 <
|
| 19 |
-
|
| 20 |
-
|
| 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`
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
|
|
|
| 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 |
|