tmp/tmprai9vegl/{from.md → to.md}
RENAMED
|
@@ -38,12 +38,13 @@ namespace std {
|
|
| 38 |
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 39 |
typedef std::reverse_iterator<iterator> reverse_iterator;
|
| 40 |
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
| 41 |
|
| 42 |
// [list.cons], construct/copy/destroy:
|
| 43 |
-
|
| 44 |
-
explicit list(
|
|
|
|
| 45 |
list(size_type n, const T& value, const Allocator& = Allocator());
|
| 46 |
template <class InputIterator>
|
| 47 |
list(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 48 |
list(const list& x);
|
| 49 |
list(list&& x);
|
|
@@ -160,24 +161,25 @@ namespace std {
|
|
| 160 |
```
|
| 161 |
|
| 162 |
#### `list` constructors, copy, and assignment <a id="list.cons">[[list.cons]]</a>
|
| 163 |
|
| 164 |
``` cpp
|
| 165 |
-
explicit list(const Allocator&
|
| 166 |
```
|
| 167 |
|
| 168 |
*Effects:* Constructs an empty list, using the specified allocator.
|
| 169 |
|
| 170 |
*Complexity:* Constant.
|
| 171 |
|
| 172 |
``` cpp
|
| 173 |
-
explicit list(size_type n);
|
| 174 |
```
|
| 175 |
|
| 176 |
-
*Effects:* Constructs a `list` with `n`
|
|
|
|
| 177 |
|
| 178 |
-
*Requires:* `T` shall be `
|
| 179 |
|
| 180 |
*Complexity:* Linear in `n`.
|
| 181 |
|
| 182 |
``` cpp
|
| 183 |
list(size_type n, const T& value,
|
|
@@ -199,40 +201,26 @@ list(InputIterator first, InputIterator last,
|
|
| 199 |
|
| 200 |
*Effects:* Constructs a `list` equal to the range \[`first`, `last`).
|
| 201 |
|
| 202 |
*Complexity:* Linear in `distance(first, last)`.
|
| 203 |
|
| 204 |
-
``` cpp
|
| 205 |
-
template <class InputIterator>
|
| 206 |
-
void assign(InputIterator first, InputIterator last);
|
| 207 |
-
```
|
| 208 |
-
|
| 209 |
-
*Effects:* Replaces the contents of the list with the range
|
| 210 |
-
`[first, last)`.
|
| 211 |
-
|
| 212 |
-
``` cpp
|
| 213 |
-
void assign(size_type n, const T& t);
|
| 214 |
-
```
|
| 215 |
-
|
| 216 |
-
*Effects:* Replaces the contents of the list with `n` copies of `t`.
|
| 217 |
-
|
| 218 |
#### `list` capacity <a id="list.capacity">[[list.capacity]]</a>
|
| 219 |
|
| 220 |
``` cpp
|
| 221 |
void resize(size_type sz);
|
| 222 |
```
|
| 223 |
|
| 224 |
-
*Effects:* If `size() < sz`, appends `sz - size()`
|
| 225 |
elements to the sequence. If `sz <= size()`, equivalent to
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
list<T>::iterator it = begin();
|
| 229 |
advance(it, sz);
|
| 230 |
erase(it, end());
|
| 231 |
```
|
| 232 |
|
| 233 |
-
*Requires:* `T` shall be `
|
| 234 |
|
| 235 |
``` cpp
|
| 236 |
void resize(size_type sz, const T& c);
|
| 237 |
```
|
| 238 |
|
|
@@ -377,11 +365,11 @@ iterator `i` for which the following conditions hold:
|
|
| 377 |
references to the erased elements.
|
| 378 |
|
| 379 |
*Throws:* Nothing unless an exception is thrown by `*i == value` or
|
| 380 |
`pred(*i) != false`.
|
| 381 |
|
| 382 |
-
*Remarks:* Stable.
|
| 383 |
|
| 384 |
*Complexity:* Exactly `size()` applications of the corresponding
|
| 385 |
predicate.
|
| 386 |
|
| 387 |
``` cpp
|
|
@@ -394,11 +382,11 @@ of equal elements referred to by the iterator `i` in the range
|
|
| 394 |
\[`first + 1`, `last`) for which `*i == *(i-1)` (for the version of
|
| 395 |
`unique` with no arguments) or `pred(*i, *(i - 1))` (for the version of
|
| 396 |
`unique` with a predicate argument) holds. Invalidates only the
|
| 397 |
iterators and references to the erased elements.
|
| 398 |
|
| 399 |
-
*Throws:* Nothing unless an exception
|
| 400 |
`pred(*i, *(i - 1))`
|
| 401 |
|
| 402 |
*Complexity:* If the range `[first, last)` is not empty, exactly
|
| 403 |
`(last - first) - 1` applications of the corresponding predicate,
|
| 404 |
otherwise no applications of the predicate.
|
|
@@ -423,13 +411,14 @@ according to the ordering defined by `comp`; that is, for every iterator
|
|
| 423 |
elements of `x` now refer to those same elements but as members of
|
| 424 |
`*this`. Iterators referring to the moved elements will continue to
|
| 425 |
refer to their elements, but they now behave as iterators into `*this`,
|
| 426 |
not into `x`.
|
| 427 |
|
| 428 |
-
*Remarks:* Stable. If `(&x != this)` the range
|
| 429 |
-
empty after the merge. No elements are copied
|
| 430 |
-
behavior is undefined if
|
|
|
|
| 431 |
|
| 432 |
*Complexity:* At most `size() + x.size() - 1` applications of `comp` if
|
| 433 |
`(&x != this)`; otherwise, no applications of `comp` are performed. If
|
| 434 |
an exception is thrown other than by a comparison there are no effects.
|
| 435 |
|
|
@@ -452,11 +441,11 @@ second version) shall define a strict weak ordering ([[alg.sorting]]).
|
|
| 452 |
|
| 453 |
*Effects:* Sorts the list according to the `operator<` or a `Compare`
|
| 454 |
function object. Does not affect the validity of iterators and
|
| 455 |
references.
|
| 456 |
|
| 457 |
-
*Remarks:* Stable.
|
| 458 |
|
| 459 |
*Complexity:* Approximately N log(N) comparisons, where `N == size()`.
|
| 460 |
|
| 461 |
#### `list` specialized algorithms <a id="list.special">[[list.special]]</a>
|
| 462 |
|
|
|
|
| 38 |
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 39 |
typedef std::reverse_iterator<iterator> reverse_iterator;
|
| 40 |
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
| 41 |
|
| 42 |
// [list.cons], construct/copy/destroy:
|
| 43 |
+
list() : list(Allocator()) { }
|
| 44 |
+
explicit list(const Allocator&);
|
| 45 |
+
explicit list(size_type n, const Allocator& = Allocator());
|
| 46 |
list(size_type n, const T& value, const Allocator& = Allocator());
|
| 47 |
template <class InputIterator>
|
| 48 |
list(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 49 |
list(const list& x);
|
| 50 |
list(list&& x);
|
|
|
|
| 161 |
```
|
| 162 |
|
| 163 |
#### `list` constructors, copy, and assignment <a id="list.cons">[[list.cons]]</a>
|
| 164 |
|
| 165 |
``` cpp
|
| 166 |
+
explicit list(const Allocator&);
|
| 167 |
```
|
| 168 |
|
| 169 |
*Effects:* Constructs an empty list, using the specified allocator.
|
| 170 |
|
| 171 |
*Complexity:* Constant.
|
| 172 |
|
| 173 |
``` cpp
|
| 174 |
+
explicit list(size_type n, const Allocator& = Allocator());
|
| 175 |
```
|
| 176 |
|
| 177 |
+
*Effects:* Constructs a `list` with `n` default-inserted elements using
|
| 178 |
+
the specified allocator.
|
| 179 |
|
| 180 |
+
*Requires:* `T` shall be `DefaultInsertable` into `*this`.
|
| 181 |
|
| 182 |
*Complexity:* Linear in `n`.
|
| 183 |
|
| 184 |
``` cpp
|
| 185 |
list(size_type n, const T& value,
|
|
|
|
| 201 |
|
| 202 |
*Effects:* Constructs a `list` equal to the range \[`first`, `last`).
|
| 203 |
|
| 204 |
*Complexity:* Linear in `distance(first, last)`.
|
| 205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
#### `list` capacity <a id="list.capacity">[[list.capacity]]</a>
|
| 207 |
|
| 208 |
``` cpp
|
| 209 |
void resize(size_type sz);
|
| 210 |
```
|
| 211 |
|
| 212 |
+
*Effects:* If `size() < sz`, appends `sz - size()` default-inserted
|
| 213 |
elements to the sequence. If `sz <= size()`, equivalent to
|
| 214 |
|
| 215 |
``` cpp
|
| 216 |
list<T>::iterator it = begin();
|
| 217 |
advance(it, sz);
|
| 218 |
erase(it, end());
|
| 219 |
```
|
| 220 |
|
| 221 |
+
*Requires:* `T` shall be `DefaultInsertable` into `*this`.
|
| 222 |
|
| 223 |
``` cpp
|
| 224 |
void resize(size_type sz, const T& c);
|
| 225 |
```
|
| 226 |
|
|
|
|
| 365 |
references to the erased elements.
|
| 366 |
|
| 367 |
*Throws:* Nothing unless an exception is thrown by `*i == value` or
|
| 368 |
`pred(*i) != false`.
|
| 369 |
|
| 370 |
+
*Remarks:* Stable ([[algorithm.stable]]).
|
| 371 |
|
| 372 |
*Complexity:* Exactly `size()` applications of the corresponding
|
| 373 |
predicate.
|
| 374 |
|
| 375 |
``` cpp
|
|
|
|
| 382 |
\[`first + 1`, `last`) for which `*i == *(i-1)` (for the version of
|
| 383 |
`unique` with no arguments) or `pred(*i, *(i - 1))` (for the version of
|
| 384 |
`unique` with a predicate argument) holds. Invalidates only the
|
| 385 |
iterators and references to the erased elements.
|
| 386 |
|
| 387 |
+
*Throws:* Nothing unless an exception is thrown by `*i == *(i-1)` or
|
| 388 |
`pred(*i, *(i - 1))`
|
| 389 |
|
| 390 |
*Complexity:* If the range `[first, last)` is not empty, exactly
|
| 391 |
`(last - first) - 1` applications of the corresponding predicate,
|
| 392 |
otherwise no applications of the predicate.
|
|
|
|
| 411 |
elements of `x` now refer to those same elements but as members of
|
| 412 |
`*this`. Iterators referring to the moved elements will continue to
|
| 413 |
refer to their elements, but they now behave as iterators into `*this`,
|
| 414 |
not into `x`.
|
| 415 |
|
| 416 |
+
*Remarks:* Stable ([[algorithm.stable]]). If `(&x != this)` the range
|
| 417 |
+
`[x.begin(), x.end())` is empty after the merge. No elements are copied
|
| 418 |
+
by this operation. The behavior is undefined if
|
| 419 |
+
`this->get_allocator() != x.get_allocator()`.
|
| 420 |
|
| 421 |
*Complexity:* At most `size() + x.size() - 1` applications of `comp` if
|
| 422 |
`(&x != this)`; otherwise, no applications of `comp` are performed. If
|
| 423 |
an exception is thrown other than by a comparison there are no effects.
|
| 424 |
|
|
|
|
| 441 |
|
| 442 |
*Effects:* Sorts the list according to the `operator<` or a `Compare`
|
| 443 |
function object. Does not affect the validity of iterators and
|
| 444 |
references.
|
| 445 |
|
| 446 |
+
*Remarks:* Stable ([[algorithm.stable]]).
|
| 447 |
|
| 448 |
*Complexity:* Approximately N log(N) comparisons, where `N == size()`.
|
| 449 |
|
| 450 |
#### `list` specialized algorithms <a id="list.special">[[list.special]]</a>
|
| 451 |
|