From Jason Turner

[associative.reqmts]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphosqgcwf/{from.md → to.md} +16 -17
tmp/tmphosqgcwf/{from.md → to.md} RENAMED
@@ -54,14 +54,14 @@ In this subclause,
54
 
55
  - `X` denotes an associative container class,
56
  - `a` denotes a value of type `X`,
57
  - `a2` denotes a value of a type with nodes compatible with type `X` (
58
  [[container.node.compat]]),
59
- - `b` denotes a value or type `X` or `const X`,
60
  - `u` denotes the name of a variable being declared,
61
  - `a_uniq` denotes a value of type `X` when `X` supports unique keys,
62
- - `a_eq` denotes a value of type `X` when `X` supports multiple keys,
63
  - `a_tran` denotes a value of type `X` or `const X` when the
64
  *qualified-id* `X::key_compare::is_transparent` is valid and denotes a
65
  type [[temp.deduct]],
66
  - `i` and `j` meet the *Cpp17InputIterator* requirements and refer to
67
  elements implicitly convertible to `value_type`,
@@ -69,11 +69,11 @@ In this subclause,
69
  - `rg` denotes a value of a type `R` that models
70
  `container-compatible-range<value_type>`,
71
  - `p` denotes a valid constant iterator to `a`,
72
  - `q` denotes a valid dereferenceable constant iterator to `a`,
73
  - `r` denotes a valid dereferenceable iterator to `a`,
74
- - `[q1, q2)` denotes a valid range of constant iterators in `a`,
75
  - `il` designates an object of type `initializer_list<value_type>`,
76
  - `t` denotes a value of type `X::value_type`,
77
  - `k` denotes a value of type `X::key_type`, and
78
  - `c` denotes a value of type `X::key_compare` or
79
  `const X::key_compare`;
@@ -95,19 +95,18 @@ In this subclause,
95
  - `m` denotes an allocator of a type convertible to `A`, and `nh`
96
  denotes a non-const rvalue of type `X::node_type`.
97
 
98
  A type `X` meets the *associative container* requirements if `X` meets
99
  all the requirements of an allocator-aware container
100
- [[container.requirements.general]] and the following types, statements,
101
- and expressions are well-formed and have the specified semantics, except
102
  that for `map` and `multimap`, the requirements placed on `value_type`
103
- in [[container.alloc.reqmts]] apply instead to `key_type` and
104
- `mapped_type`.
105
 
106
- [*Note 3*: For example, in some cases `key_type` and `mapped_type` are
107
- required to be *Cpp17CopyAssignable* even though the associated
108
- `value_type`, `pair<const key_type, mapped_type>`, is not
109
  *Cpp17CopyAssignable*. — *end note*]
110
 
111
  ``` cpp
112
  typename X::key_type
113
  ```
@@ -326,12 +325,11 @@ a.emplace_hint(p, args)
326
 
327
  *Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`,
328
  except that the element is inserted as close as possible to the position
329
  just prior to `p`.
330
 
331
- *Returns:* An iterator pointing to the element with the key equivalent
332
- to the newly inserted element.
333
 
334
  *Complexity:* Logarithmic in general, but amortized constant if the
335
  element is inserted right before `p`.
336
 
337
  ``` cpp
@@ -540,21 +538,22 @@ a.extract(q)
540
  a.merge(a2)
541
  ```
542
 
543
  *Result:* `void`
544
 
545
- *Preconditions:* `a.get_allocator() == a2.get_allocator()`.
546
 
547
  *Effects:* Attempts to extract each element in `a2` and insert it into
548
  `a` using the comparison object of `a`. In containers with unique keys,
549
  if there is an element in `a` with key equivalent to the key of an
550
  element from `a2`, then that element is not extracted from `a2`.
551
 
552
  *Ensures:* Pointers and references to the transferred elements of `a2`
553
- refer to those same elements but as members of `a`. Iterators referring
554
- to the transferred elements will continue to refer to their elements,
555
- but they now behave as iterators into `a`, not into `a2`.
 
556
 
557
  *Throws:* Nothing unless the comparison object throws.
558
 
559
  *Complexity:* N log(`a.size()+` N), where N has the value `a2.size()`.
560
 
@@ -726,11 +725,11 @@ b.upper_bound(k)
726
  *Result:* `iterator`; `const_iterator` for constant `b`.
727
 
728
  *Returns:* An iterator pointing to the first element with key greater
729
  than `k`, or `b.end()` if such an element is not found.
730
 
731
- *Complexity:* Logarithmic,
732
 
733
  ``` cpp
734
  a_tran.upper_bound(ku)
735
  ```
736
 
 
54
 
55
  - `X` denotes an associative container class,
56
  - `a` denotes a value of type `X`,
57
  - `a2` denotes a value of a type with nodes compatible with type `X` (
58
  [[container.node.compat]]),
59
+ - `b` denotes a value of type `X` or `const X`,
60
  - `u` denotes the name of a variable being declared,
61
  - `a_uniq` denotes a value of type `X` when `X` supports unique keys,
62
+ - `a_eq` denotes a value of type `X` when `X` supports equivalent keys,
63
  - `a_tran` denotes a value of type `X` or `const X` when the
64
  *qualified-id* `X::key_compare::is_transparent` is valid and denotes a
65
  type [[temp.deduct]],
66
  - `i` and `j` meet the *Cpp17InputIterator* requirements and refer to
67
  elements implicitly convertible to `value_type`,
 
69
  - `rg` denotes a value of a type `R` that models
70
  `container-compatible-range<value_type>`,
71
  - `p` denotes a valid constant iterator to `a`,
72
  - `q` denotes a valid dereferenceable constant iterator to `a`,
73
  - `r` denotes a valid dereferenceable iterator to `a`,
74
+ - \[`q1`, `q2`) denotes a valid range of constant iterators in `a`,
75
  - `il` designates an object of type `initializer_list<value_type>`,
76
  - `t` denotes a value of type `X::value_type`,
77
  - `k` denotes a value of type `X::key_type`, and
78
  - `c` denotes a value of type `X::key_compare` or
79
  `const X::key_compare`;
 
95
  - `m` denotes an allocator of a type convertible to `A`, and `nh`
96
  denotes a non-const rvalue of type `X::node_type`.
97
 
98
  A type `X` meets the *associative container* requirements if `X` meets
99
  all the requirements of an allocator-aware container
100
+ [[container.alloc.reqmts]] and the following types, statements, and
101
+ expressions are well-formed and have the specified semantics, except
102
  that for `map` and `multimap`, the requirements placed on `value_type`
103
+ in [[container.reqmts]] apply instead to `key_type` and `mapped_type`.
 
104
 
105
+ [*Note 3*: For example, in some cases `key_type` and `mapped_type` need
106
+ to be *Cpp17CopyAssignable* even though the associated `value_type`,
107
+ `pair<const key_type, mapped_type>`, is not
108
  *Cpp17CopyAssignable*. — *end note*]
109
 
110
  ``` cpp
111
  typename X::key_type
112
  ```
 
325
 
326
  *Effects:* Equivalent to `a.emplace(std::forward<Args>(args)...)`,
327
  except that the element is inserted as close as possible to the position
328
  just prior to `p`.
329
 
330
+ *Returns:* The iterator returned by `emplace`.
 
331
 
332
  *Complexity:* Logarithmic in general, but amortized constant if the
333
  element is inserted right before `p`.
334
 
335
  ``` cpp
 
538
  a.merge(a2)
539
  ```
540
 
541
  *Result:* `void`
542
 
543
+ *Preconditions:* `a.get_allocator() == a2.get_allocator()` is `true`.
544
 
545
  *Effects:* Attempts to extract each element in `a2` and insert it into
546
  `a` using the comparison object of `a`. In containers with unique keys,
547
  if there is an element in `a` with key equivalent to the key of an
548
  element from `a2`, then that element is not extracted from `a2`.
549
 
550
  *Ensures:* Pointers and references to the transferred elements of `a2`
551
+ refer to those same elements but as members of `a`. If `a.begin()` and
552
+ `a2.begin()` have the same type, iterators referring to the transferred
553
+ elements will continue to refer to their elements, but they now behave
554
+ as iterators into `a`, not into `a2`.
555
 
556
  *Throws:* Nothing unless the comparison object throws.
557
 
558
  *Complexity:* N log(`a.size()+` N), where N has the value `a2.size()`.
559
 
 
725
  *Result:* `iterator`; `const_iterator` for constant `b`.
726
 
727
  *Returns:* An iterator pointing to the first element with key greater
728
  than `k`, or `b.end()` if such an element is not found.
729
 
730
+ *Complexity:* Logarithmic.
731
 
732
  ``` cpp
733
  a_tran.upper_bound(ku)
734
  ```
735