From Jason Turner

[hive.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprdkqu8ow/{from.md → to.md} +193 -0
tmp/tmprdkqu8ow/{from.md → to.md} RENAMED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Constructors, copy, and assignment <a id="hive.cons">[[hive.cons]]</a>
2
+
3
+ ``` cpp
4
+ constexpr explicit hive(const Allocator&) noexcept;
5
+ ```
6
+
7
+ *Effects:* Constructs an empty `hive`, using the specified allocator.
8
+
9
+ *Complexity:* Constant.
10
+
11
+ ``` cpp
12
+ constexpr hive(hive_limits block_limits, const Allocator&);
13
+ ```
14
+
15
+ *Effects:* Constructs an empty `hive`, using the specified allocator.
16
+ Initializes *current-limits* with `block_limits`.
17
+
18
+ *Complexity:* Constant.
19
+
20
+ ``` cpp
21
+ explicit hive(size_type n, const Allocator& = Allocator());
22
+ hive(size_type n, hive_limits block_limits, const Allocator& = Allocator());
23
+ ```
24
+
25
+ *Preconditions:* `T` is *Cpp17DefaultInsertable* into `hive`.
26
+
27
+ *Effects:* Constructs a `hive` with `n` default-inserted elements, using
28
+ the specified allocator. If the second overload is called, also
29
+ initializes *current-limits* with `block_limits`.
30
+
31
+ *Complexity:* Linear in `n`.
32
+
33
+ ``` cpp
34
+ hive(size_type n, const T& value, const Allocator& = Allocator());
35
+ hive(size_type n, const T& value, hive_limits block_limits, const Allocator& = Allocator());
36
+ ```
37
+
38
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `hive`.
39
+
40
+ *Effects:* Constructs a `hive` with `n` copies of `value`, using the
41
+ specified allocator. If the second overload is called, also initializes
42
+ *current-limits* with `block_limits`.
43
+
44
+ *Complexity:* Linear in `n`.
45
+
46
+ ``` cpp
47
+ template<class InputIterator>
48
+ hive(InputIterator first, InputIterator last, const Allocator& = Allocator());
49
+ template<class InputIterator>
50
+ hive(InputIterator first, InputIterator last, hive_limits block_limits,
51
+ const Allocator& = Allocator());
52
+ ```
53
+
54
+ *Effects:* Constructs a `hive` equal to the range \[`first`, `last`),
55
+ using the specified allocator. If the second overload is called, also
56
+ initializes *current-limits* with `block_limits`.
57
+
58
+ *Complexity:* Linear in `distance(first, last)`.
59
+
60
+ ``` cpp
61
+ template<container-compatible-range<T> R>
62
+ hive(from_range_t, R&& rg, const Allocator& = Allocator());
63
+ template<container-compatible-range<T> R>
64
+ hive(from_range_t, R&& rg, hive_limits block_limits, const Allocator& = Allocator());
65
+ ```
66
+
67
+ *Effects:* Constructs a `hive` object with the elements of the range
68
+ `rg`, using the specified allocator. If the second overload is called,
69
+ also initializes *current-limits* with `block_limits`.
70
+
71
+ *Complexity:* Linear in `ranges::distance(rg)`.
72
+
73
+ ``` cpp
74
+ hive(const hive& x);
75
+ hive(const hive& x, const type_identity_t<Allocator>& alloc);
76
+ ```
77
+
78
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `hive`.
79
+
80
+ *Effects:* Constructs a `hive` object with the elements of `x`. If the
81
+ second overload is called, uses `alloc`. Initializes *current-limits*
82
+ with `x.`*`current-limits`*.
83
+
84
+ *Complexity:* Linear in `x.size()`.
85
+
86
+ ``` cpp
87
+ hive(hive&& x) noexcept;
88
+ hive(hive&& x, const type_identity_t<Allocator>& alloc);
89
+ ```
90
+
91
+ *Preconditions:* For the second overload, when
92
+ `allocator_traits<alloc>::is_always_equal::value` is `false`, `T` meets
93
+ the *Cpp17MoveInsertable* requirements.
94
+
95
+ *Effects:* When the first overload is called, or the second overload is
96
+ called and `alloc == x.get_allocator()` is `true`, *current-limits* is
97
+ set to `x.`*`current-limits`* and each element block is moved from `x`
98
+ into `*this`. Pointers and references to the elements of `x` now refer
99
+ to those same elements but as members of `*this`. Iterators referring to
100
+ the elements of `x` will continue to refer to their elements, but they
101
+ now behave as iterators into `*this`.
102
+
103
+ If the second overload is called and `alloc == x.get_allocator()` is
104
+ `false`, each element in `x` is moved into `*this`. References, pointers
105
+ and iterators referring to the elements of `x`, as well as the
106
+ past-the-end iterator of `x`, are invalidated.
107
+
108
+ *Ensures:* `x.empty()` is `true`.
109
+
110
+ *Complexity:* If the second overload is called and
111
+ `alloc == x.get_allocator()` is `false`, linear in `x.size()`. Otherwise
112
+ constant.
113
+
114
+ ``` cpp
115
+ hive(initializer_list<T> il, const Allocator& = Allocator());
116
+ hive(initializer_list<T> il, hive_limits block_limits, const Allocator& = Allocator());
117
+ ```
118
+
119
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `hive`.
120
+
121
+ *Effects:* Constructs a `hive` object with the elements of `il`, using
122
+ the specified allocator. If the second overload is called, also
123
+ initializes *current-limits* with `block_limits`.
124
+
125
+ *Complexity:* Linear in `il.size()`.
126
+
127
+ ``` cpp
128
+ hive& operator=(const hive& x);
129
+ ```
130
+
131
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `hive` and
132
+ *Cpp17CopyAssignable*.
133
+
134
+ *Effects:* All elements in `*this` are either copy-assigned to, or
135
+ destroyed. All elements in `x` are copied into `*this`.
136
+
137
+ [*Note 1*: *current-limits* is unchanged. — *end note*]
138
+
139
+ *Complexity:* Linear in `size() + x.size()`.
140
+
141
+ ``` cpp
142
+ hive& operator=(hive&& x)
143
+ noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
144
+ allocator_traits<Allocator>::is_always_equal::value);
145
+ ```
146
+
147
+ *Preconditions:* When
148
+
149
+ ``` cpp
150
+ (allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
151
+ allocator_traits<Allocator>::is_always_equal::value)
152
+ ```
153
+
154
+ is `false`, `T` is *Cpp17MoveInsertable* into `hive` and
155
+ *Cpp17MoveAssignable*.
156
+
157
+ *Effects:* Each element in `*this` is either move-assigned to, or
158
+ destroyed. When
159
+
160
+ ``` cpp
161
+ (allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
162
+ get_allocator() == x.get_allocator())
163
+ ```
164
+
165
+ is `true`, *current-limits* is set to `x.`*`current-limits`* and each
166
+ element block is moved from `x` into `*this`. Pointers and references to
167
+ the elements of `x` now refer to those same elements but as members of
168
+ `*this`. Iterators referring to the elements of `x` will continue to
169
+ refer to their elements, but they now behave as iterators into `*this`,
170
+ not into `x`.
171
+
172
+ When
173
+
174
+ ``` cpp
175
+ (allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
176
+ get_allocator() == x.get_allocator())
177
+ ```
178
+
179
+ is `false`, each element in `x` is moved into `*this`. References,
180
+ pointers and iterators referring to the elements of `x`, as well as the
181
+ past-the-end iterator of `x`, are invalidated.
182
+
183
+ *Ensures:* `x.empty()` is `true`.
184
+
185
+ *Complexity:* Linear in `size()`. If
186
+
187
+ ``` cpp
188
+ (allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
189
+ get_allocator() == x.get_allocator())
190
+ ```
191
+
192
+ is `false`, also linear in `x.size()`.
193
+