tmp/tmpvcgpnw7e/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="flat.multiset.overview">[[flat.multiset.overview]]</a>
|
| 2 |
+
|
| 3 |
+
A `flat_multiset` is a container adaptor that provides an associative
|
| 4 |
+
container interface that supports equivalent keys (i.e., possibly
|
| 5 |
+
containing multiple copies of the same key value) and provides for fast
|
| 6 |
+
retrieval of the keys themselves. `flat_multiset` supports iterators
|
| 7 |
+
that model the `random_access_iterator` concept
|
| 8 |
+
[[iterator.concept.random.access]].
|
| 9 |
+
|
| 10 |
+
A `flat_multiset` meets all of the requirements for a container
|
| 11 |
+
[[container.reqmts]] and for a reversible container
|
| 12 |
+
[[container.rev.reqmts]], plus the optional container requirements
|
| 13 |
+
[[container.opt.reqmts]]. `flat_multiset` meets the requirements of an
|
| 14 |
+
associative container [[associative.reqmts]], except that:
|
| 15 |
+
|
| 16 |
+
- it does not meet the requirements related to node handles
|
| 17 |
+
[[container.node.overview]],
|
| 18 |
+
- it does not meet the requirements related to iterator invalidation,
|
| 19 |
+
and
|
| 20 |
+
- the time complexity of the operations that insert or erase a single
|
| 21 |
+
element from the set is linear, including the ones that take an
|
| 22 |
+
insertion position iterator.
|
| 23 |
+
|
| 24 |
+
[*Note 1*: A `flat_multiset` does not meet the additional requirements
|
| 25 |
+
of an allocator-aware container, as described in
|
| 26 |
+
[[container.alloc.reqmts]]. — *end note*]
|
| 27 |
+
|
| 28 |
+
A `flat_multiset` also provides most operations described in
|
| 29 |
+
[[associative.reqmts]] for equal keys. This means that a `flat_multiset`
|
| 30 |
+
supports the `a_eq` operations in [[associative.reqmts]] but not the
|
| 31 |
+
`a_uniq` operations. For a `flat_multiset<Key>`, both the `key_type` and
|
| 32 |
+
`value_type` are `Key`.
|
| 33 |
+
|
| 34 |
+
Descriptions are provided here only for operations on `flat_multiset`
|
| 35 |
+
that are not described in one of the general sections or for operations
|
| 36 |
+
where there is additional semantic information.
|
| 37 |
+
|
| 38 |
+
A `flat_multiset` maintains the invariant that the keys are sorted with
|
| 39 |
+
respect to the comparison object.
|
| 40 |
+
|
| 41 |
+
If any member function in [[flat.multiset.defn]] exits via an exception,
|
| 42 |
+
the invariant is restored.
|
| 43 |
+
|
| 44 |
+
[*Note 2*: This can result in the `flat_multiset`’s being
|
| 45 |
+
emptied. — *end note*]
|
| 46 |
+
|
| 47 |
+
Any sequence container [[sequence.reqmts]] supporting
|
| 48 |
+
*Cpp17RandomAccessIterator* can be used to instantiate `flat_multiset`.
|
| 49 |
+
In particular, `vector` [[vector]] and `deque` [[deque]] can be used.
|
| 50 |
+
|
| 51 |
+
[*Note 3*: `vector<bool>` is not a sequence container. — *end note*]
|
| 52 |
+
|
| 53 |
+
The program is ill-formed if `Key` is not the same type as
|
| 54 |
+
`KeyContainer::value_type`.
|
| 55 |
+
|
| 56 |
+
The effect of calling a constructor or member function that takes a
|
| 57 |
+
`sorted_equivalent_t` argument with a range that is not sorted with
|
| 58 |
+
respect to `key_comp()` is undefined.
|
| 59 |
+
|