tmp/tmpikwx9fqd/{from.md → to.md}
RENAMED
|
@@ -81,14 +81,14 @@ constexpr size_type capacity() const noexcept;
|
|
| 81 |
constexpr void reserve(size_type res_arg);
|
| 82 |
```
|
| 83 |
|
| 84 |
*Effects:* A directive that informs a `basic_string` of a planned change
|
| 85 |
in size, so that the storage allocation can be managed accordingly.
|
| 86 |
-
|
| 87 |
-
`reserve` if reallocation happens; and equal to the previous
|
| 88 |
-
`capacity()` otherwise. Reallocation happens at this point if
|
| 89 |
-
if the current capacity is less than the argument of `reserve
|
| 90 |
|
| 91 |
*Throws:* `length_error` if `res_arg > max_size()` or any exceptions
|
| 92 |
thrown by `allocator_traits` `<Allocator>::allocate`.
|
| 93 |
|
| 94 |
``` cpp
|
|
@@ -119,10 +119,10 @@ constexpr void clear() noexcept;
|
|
| 119 |
```
|
| 120 |
|
| 121 |
*Effects:* Equivalent to: `erase(begin(), end());`
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
-
|
| 125 |
```
|
| 126 |
|
| 127 |
*Effects:* Equivalent to: `return size() == 0;`
|
| 128 |
|
|
|
|
| 81 |
constexpr void reserve(size_type res_arg);
|
| 82 |
```
|
| 83 |
|
| 84 |
*Effects:* A directive that informs a `basic_string` of a planned change
|
| 85 |
in size, so that the storage allocation can be managed accordingly.
|
| 86 |
+
Following a call to `reserve`, `capacity()` is greater or equal to the
|
| 87 |
+
argument of `reserve` if reallocation happens; and equal to the previous
|
| 88 |
+
value of `capacity()` otherwise. Reallocation happens at this point if
|
| 89 |
+
and only if the current capacity is less than the argument of `reserve`.
|
| 90 |
|
| 91 |
*Throws:* `length_error` if `res_arg > max_size()` or any exceptions
|
| 92 |
thrown by `allocator_traits` `<Allocator>::allocate`.
|
| 93 |
|
| 94 |
``` cpp
|
|
|
|
| 119 |
```
|
| 120 |
|
| 121 |
*Effects:* Equivalent to: `erase(begin(), end());`
|
| 122 |
|
| 123 |
``` cpp
|
| 124 |
+
constexpr bool empty() const noexcept;
|
| 125 |
```
|
| 126 |
|
| 127 |
*Effects:* Equivalent to: `return size() == 0;`
|
| 128 |
|