tmp/tmpy_yvz0s1/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
#### Modifiers <a id="flat.set.modifiers">[[flat.set.modifiers]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
template<class K> pair<iterator, bool> insert(K&& x);
|
| 5 |
-
template<class K> iterator insert(const_iterator hint, K&& x);
|
| 6 |
```
|
| 7 |
|
| 8 |
*Constraints:* The *qualified-id* `Compare::is_transparent` is valid and
|
| 9 |
denotes a type. `is_constructible_v<value_type, K>` is `true`.
|
| 10 |
|
| 11 |
*Preconditions:* The conversion from `x` into `value_type` constructs an
|
| 12 |
-
object `u`, for which `find(x) == find(u)` is true.
|
| 13 |
|
| 14 |
*Effects:* If the set already contains an element equivalent to `x`,
|
| 15 |
`*this` and `x` are unchanged. Otherwise, inserts a new element as if by
|
| 16 |
`emplace(std::forward<K>(x))`.
|
| 17 |
|
|
@@ -19,11 +19,11 @@ object `u`, for which `find(x) == find(u)` is true.
|
|
| 19 |
pair is `true` if and only if the insertion took place. The returned
|
| 20 |
iterator points to the element whose key is equivalent to `x`.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template<class InputIterator>
|
| 24 |
-
void insert(InputIterator first, InputIterator last);
|
| 25 |
```
|
| 26 |
|
| 27 |
*Effects:* Adds elements to *c* as if by:
|
| 28 |
|
| 29 |
``` cpp
|
|
@@ -42,20 +42,20 @@ M is `distance(first, last)`.
|
|
| 42 |
*Remarks:* Since this operation performs an in-place merge, it may
|
| 43 |
allocate memory.
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
template<class InputIterator>
|
| 47 |
-
void insert(sorted_unique_t, InputIterator first, InputIterator last);
|
| 48 |
```
|
| 49 |
|
| 50 |
*Effects:* Equivalent to `insert(first, last)`.
|
| 51 |
|
| 52 |
*Complexity:* Linear.
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
template<container-compatible-range<value_type> R>
|
| 56 |
-
void insert_range(R&& rg);
|
| 57 |
```
|
| 58 |
|
| 59 |
*Effects:* Adds elements to *c* as if by:
|
| 60 |
|
| 61 |
``` cpp
|
|
@@ -75,31 +75,31 @@ M is `ranges::distance(rg)`.
|
|
| 75 |
|
| 76 |
*Remarks:* Since this operation performs an in-place merge, it may
|
| 77 |
allocate memory.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
-
void swap(flat_set& y) noexcept;
|
| 81 |
```
|
| 82 |
|
| 83 |
*Effects:* Equivalent to:
|
| 84 |
|
| 85 |
``` cpp
|
| 86 |
ranges::swap(compare, y.compare);
|
| 87 |
ranges::swap(c, y.c);
|
| 88 |
```
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
-
container_type extract() &&;
|
| 92 |
```
|
| 93 |
|
| 94 |
*Ensures:* `*this` is emptied, even if the function exits via an
|
| 95 |
exception.
|
| 96 |
|
| 97 |
*Returns:* `std::move(`*`c`*`)`.
|
| 98 |
|
| 99 |
``` cpp
|
| 100 |
-
void replace(container_type&& cont);
|
| 101 |
```
|
| 102 |
|
| 103 |
*Preconditions:* The elements of `cont` are sorted with respect to
|
| 104 |
*compare*, and `cont` contains no equal elements.
|
| 105 |
|
|
|
|
| 1 |
#### Modifiers <a id="flat.set.modifiers">[[flat.set.modifiers]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
template<class K> constexpr pair<iterator, bool> insert(K&& x);
|
| 5 |
+
template<class K> constexpr iterator insert(const_iterator hint, K&& x);
|
| 6 |
```
|
| 7 |
|
| 8 |
*Constraints:* The *qualified-id* `Compare::is_transparent` is valid and
|
| 9 |
denotes a type. `is_constructible_v<value_type, K>` is `true`.
|
| 10 |
|
| 11 |
*Preconditions:* The conversion from `x` into `value_type` constructs an
|
| 12 |
+
object `u`, for which `find(x) == find(u)` is `true`.
|
| 13 |
|
| 14 |
*Effects:* If the set already contains an element equivalent to `x`,
|
| 15 |
`*this` and `x` are unchanged. Otherwise, inserts a new element as if by
|
| 16 |
`emplace(std::forward<K>(x))`.
|
| 17 |
|
|
|
|
| 19 |
pair is `true` if and only if the insertion took place. The returned
|
| 20 |
iterator points to the element whose key is equivalent to `x`.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template<class InputIterator>
|
| 24 |
+
constexpr void insert(InputIterator first, InputIterator last);
|
| 25 |
```
|
| 26 |
|
| 27 |
*Effects:* Adds elements to *c* as if by:
|
| 28 |
|
| 29 |
``` cpp
|
|
|
|
| 42 |
*Remarks:* Since this operation performs an in-place merge, it may
|
| 43 |
allocate memory.
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
template<class InputIterator>
|
| 47 |
+
constexpr void insert(sorted_unique_t, InputIterator first, InputIterator last);
|
| 48 |
```
|
| 49 |
|
| 50 |
*Effects:* Equivalent to `insert(first, last)`.
|
| 51 |
|
| 52 |
*Complexity:* Linear.
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
template<container-compatible-range<value_type> R>
|
| 56 |
+
constexpr void insert_range(R&& rg);
|
| 57 |
```
|
| 58 |
|
| 59 |
*Effects:* Adds elements to *c* as if by:
|
| 60 |
|
| 61 |
``` cpp
|
|
|
|
| 75 |
|
| 76 |
*Remarks:* Since this operation performs an in-place merge, it may
|
| 77 |
allocate memory.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
+
constexpr void swap(flat_set& y) noexcept;
|
| 81 |
```
|
| 82 |
|
| 83 |
*Effects:* Equivalent to:
|
| 84 |
|
| 85 |
``` cpp
|
| 86 |
ranges::swap(compare, y.compare);
|
| 87 |
ranges::swap(c, y.c);
|
| 88 |
```
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
+
constexpr container_type extract() &&;
|
| 92 |
```
|
| 93 |
|
| 94 |
*Ensures:* `*this` is emptied, even if the function exits via an
|
| 95 |
exception.
|
| 96 |
|
| 97 |
*Returns:* `std::move(`*`c`*`)`.
|
| 98 |
|
| 99 |
``` cpp
|
| 100 |
+
constexpr void replace(container_type&& cont);
|
| 101 |
```
|
| 102 |
|
| 103 |
*Preconditions:* The elements of `cont` are sorted with respect to
|
| 104 |
*compare*, and `cont` contains no equal elements.
|
| 105 |
|