tmp/tmp4vrpsb88/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Capacity <a id="hive.capacity">[[hive.capacity]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
size_type capacity() const noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Returns:* The total number of elements that `*this` can hold without
|
| 8 |
+
requiring allocation of more element blocks.
|
| 9 |
+
|
| 10 |
+
*Complexity:* Constant.
|
| 11 |
+
|
| 12 |
+
``` cpp
|
| 13 |
+
void reserve(size_type n);
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
*Effects:* If `n <= capacity()` is `true`, there are no effects.
|
| 17 |
+
Otherwise increases `capacity()` by allocating reserved blocks.
|
| 18 |
+
|
| 19 |
+
*Ensures:* `capacity() >= n` is `true`.
|
| 20 |
+
|
| 21 |
+
*Throws:* `length_error` if `n > max_size()`, as well as any exceptions
|
| 22 |
+
thrown by the allocator.
|
| 23 |
+
|
| 24 |
+
*Complexity:* Linear in the number of reserved blocks allocated.
|
| 25 |
+
|
| 26 |
+
*Remarks:* The size of the sequence is not changed. All references,
|
| 27 |
+
pointers, and iterators referring to elements in `*this`, as well as the
|
| 28 |
+
past-the-end iterator, remain valid.
|
| 29 |
+
|
| 30 |
+
``` cpp
|
| 31 |
+
void shrink_to_fit();
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
*Preconditions:* `T` is *Cpp17MoveInsertable* into `hive`.
|
| 35 |
+
|
| 36 |
+
*Effects:* `shrink_to_fit` is a non-binding request to reduce
|
| 37 |
+
`capacity()` to be closer to `size()`.
|
| 38 |
+
|
| 39 |
+
[*Note 1*: The request is non-binding to allow latitude for
|
| 40 |
+
implementation-specific optimizations. — *end note*]
|
| 41 |
+
|
| 42 |
+
It does not increase `capacity()`, but may reduce `capacity()`. It may
|
| 43 |
+
reallocate elements. If `capacity()` is already equal to `size()`, there
|
| 44 |
+
are no effects. If an exception is thrown during allocation of a new
|
| 45 |
+
element block, `capacity()` may be reduced and reallocation may occur.
|
| 46 |
+
Otherwise if an exception is thrown, the effects are unspecified.
|
| 47 |
+
|
| 48 |
+
*Complexity:* If reallocation happens, linear in the size of the
|
| 49 |
+
sequence.
|
| 50 |
+
|
| 51 |
+
*Remarks:* If reallocation happens, the order of the elements in `*this`
|
| 52 |
+
may change and all references, pointers, and iterators referring to the
|
| 53 |
+
elements in `*this`, as well as the past-the-end iterator, are
|
| 54 |
+
invalidated.
|
| 55 |
+
|
| 56 |
+
``` cpp
|
| 57 |
+
void trim_capacity() noexcept;
|
| 58 |
+
void trim_capacity(size_type n) noexcept;
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
*Effects:* For the first overload, all reserved blocks are deallocated,
|
| 62 |
+
and `capacity()` is reduced accordingly. For the second overload,
|
| 63 |
+
`capacity()` is reduced to no less than `n`.
|
| 64 |
+
|
| 65 |
+
*Complexity:* Linear in the number of reserved blocks deallocated.
|
| 66 |
+
|
| 67 |
+
*Remarks:* All references, pointers, and iterators referring to elements
|
| 68 |
+
in `*this`, as well as the past-the-end iterator, remain valid.
|
| 69 |
+
|
| 70 |
+
``` cpp
|
| 71 |
+
constexpr hive_limits block_capacity_limits() const noexcept;
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
*Returns:* *current-limits*.
|
| 75 |
+
|
| 76 |
+
*Complexity:* Constant.
|
| 77 |
+
|
| 78 |
+
``` cpp
|
| 79 |
+
static constexpr hive_limits block_capacity_default_limits() noexcept;
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
*Returns:* A `hive_limits` struct with the `min` and `max` members set
|
| 83 |
+
to the implementation’s default limits.
|
| 84 |
+
|
| 85 |
+
*Complexity:* Constant.
|
| 86 |
+
|
| 87 |
+
``` cpp
|
| 88 |
+
static constexpr hive_limits block_capacity_hard_limits() noexcept;
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
*Returns:* A `hive_limits` struct with the `min` and `max` members set
|
| 92 |
+
to the implementation’s hard limits.
|
| 93 |
+
|
| 94 |
+
*Complexity:* Constant.
|
| 95 |
+
|
| 96 |
+
``` cpp
|
| 97 |
+
void reshape(hive_limits block_limits);
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
*Preconditions:* `T` is *Cpp17MoveInsertable* into `hive`.
|
| 101 |
+
|
| 102 |
+
*Effects:* For any active blocks not within the bounds of
|
| 103 |
+
`block_limits`, the elements within those active blocks are reallocated
|
| 104 |
+
to new or existing element blocks which are within the bounds. Any
|
| 105 |
+
element blocks not within the bounds of `block_limits` are deallocated.
|
| 106 |
+
If an exception is thrown during allocation of a new element block,
|
| 107 |
+
`capacity()` may be reduced, reallocation may occur, and
|
| 108 |
+
*current-limits* may be assigned a value other than `block_limits`.
|
| 109 |
+
Otherwise `block_limits` is assigned to *current-limits*. If any other
|
| 110 |
+
exception is thrown the effects are unspecified.
|
| 111 |
+
|
| 112 |
+
*Ensures:* `size()` is unchanged.
|
| 113 |
+
|
| 114 |
+
*Complexity:* Linear in the number of element blocks in `*this`. If
|
| 115 |
+
reallocation happens, also linear in the number of elements reallocated.
|
| 116 |
+
|
| 117 |
+
*Remarks:* This operation may change `capacity()`. If reallocation
|
| 118 |
+
happens, the order of the elements in `*this` may change. Reallocation
|
| 119 |
+
invalidates all references, pointers, and iterators referring to the
|
| 120 |
+
elements in `*this`, as well as the past-the-end iterator.
|
| 121 |
+
|
| 122 |
+
[*Note 2*: If no reallocation happens, they remain
|
| 123 |
+
valid. — *end note*]
|
| 124 |
+
|