From Jason Turner

[flat.multiset.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp563g6s97/{from.md → to.md} +77 -0
tmp/tmp563g6s97/{from.md → to.md} RENAMED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Modifiers <a id="flat.multiset.modifiers">[[flat.multiset.modifiers]]</a>
2
+
3
+ ``` cpp
4
+ template<class... Args> iterator emplace(Args&&... args);
5
+ ```
6
+
7
+ *Constraints:* `is_constructible_v<value_type, Args...>` is `true`.
8
+
9
+ *Effects:* First, initializes an object `t` of type `value_type` with
10
+ `std::forward<Args>(args)...`, then inserts `t` as if by:
11
+
12
+ ``` cpp
13
+ auto it = ranges::upper_bound(c, t, compare);
14
+ c.insert(it, std::move(t));
15
+ ```
16
+
17
+ *Returns:* An iterator that points to the inserted element.
18
+
19
+ ``` cpp
20
+ template<class InputIterator>
21
+ void insert(InputIterator first, InputIterator last);
22
+ ```
23
+
24
+ *Effects:* Adds elements to *c* as if by:
25
+
26
+ ``` cpp
27
+ c.insert(c.end(), first, last);
28
+ ```
29
+
30
+ Then, sorts the range of newly inserted elements with respect to
31
+ *compare*, and merges the resulting sorted range and the sorted range of
32
+ pre-existing elements into a single sorted range.
33
+
34
+ *Complexity:* N + M log M, where N is `size()` before the operation and
35
+ M is `distance(first, last)`.
36
+
37
+ *Remarks:* Since this operation performs an in-place merge, it may
38
+ allocate memory.
39
+
40
+ ``` cpp
41
+ template<class InputIterator>
42
+ void insert(sorted_equivalent_t, InputIterator first, InputIterator last);
43
+ ```
44
+
45
+ *Effects:* Equivalent to `insert(first, last)`.
46
+
47
+ *Complexity:* Linear.
48
+
49
+ ``` cpp
50
+ void swap(flat_multiset& y) noexcept;
51
+ ```
52
+
53
+ *Effects:* Equivalent to:
54
+
55
+ ``` cpp
56
+ ranges::swap(compare, y.compare);
57
+ ranges::swap(c, y.c);
58
+ ```
59
+
60
+ ``` cpp
61
+ container_type extract() &&;
62
+ ```
63
+
64
+ *Ensures:* `*this` is emptied, even if the function exits via an
65
+ exception.
66
+
67
+ *Returns:* `std::move(c)`.
68
+
69
+ ``` cpp
70
+ void replace(container_type&& cont);
71
+ ```
72
+
73
+ *Preconditions:* The elements of `cont` are sorted with respect to
74
+ *compare*.
75
+
76
+ *Effects:* Equivalent to: `c = std::move(cont);`
77
+