From Jason Turner

[flat.multimap.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpgrduy0s9/{from.md → to.md} +75 -0
tmp/tmpgrduy0s9/{from.md → to.md} RENAMED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="flat.multimap.overview">[[flat.multimap.overview]]</a>
2
+
3
+ A `flat_multimap` 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 values of another type `T` based on the keys.
7
+ `flat_multimap` supports iterators that meet the *Cpp17InputIterator*
8
+ requirements and model the `random_access_iterator` concept
9
+ [[iterator.concept.random.access]].
10
+
11
+ A `flat_multimap` meets all of the requirements for a container
12
+ [[container.reqmts]] and for a reversible container
13
+ [[container.rev.reqmts]], plus the optional container requirements
14
+ [[container.opt.reqmts]]. `flat_multimap` meets the requirements of an
15
+ associative container [[associative.reqmts]], except that:
16
+
17
+ - it does not meet the requirements related to node handles
18
+ [[container.node]],
19
+ - it does not meet the requirements related to iterator invalidation,
20
+ and
21
+ - the time complexity of the operations that insert or erase a single
22
+ element from the map is linear, including the ones that take an
23
+ insertion position iterator.
24
+
25
+ [*Note 1*: A `flat_multimap` does not meet the additional requirements
26
+ of an allocator-aware container
27
+ [[container.alloc.reqmts]]. — *end note*]
28
+
29
+ A `flat_multimap` also provides most operations described in
30
+ [[associative.reqmts]] for equal keys. This means that a `flat_multimap`
31
+ supports the `a_eq` operations in [[associative.reqmts]] but not the
32
+ `a_uniq` operations. For a `flat_multimap<Key, T>` the `key_type` is
33
+ `Key` and the `value_type` is `pair<Key, T>`.
34
+
35
+ Except as otherwise noted, operations on `flat_multimap` are equivalent
36
+ to those of `flat_map`, except that `flat_multimap` operations do not
37
+ remove or replace elements with equal keys.
38
+
39
+ [*Example 1*: `flat_multimap` constructors and emplace do not erase
40
+ non-unique elements after sorting them. — *end example*]
41
+
42
+ A `flat_multimap` maintains the following invariants:
43
+
44
+ - it contains the same number of keys and values;
45
+ - the keys are sorted with respect to the comparison object; and
46
+ - the value at offset `off` within the value container is the value
47
+ associated with the key at offset `off` within the key container.
48
+
49
+ If any member function in [[flat.multimap.defn]] exits via an exception,
50
+ the invariants are restored.
51
+
52
+ [*Note 2*: This can result in the `flat_multimap` being
53
+ emptied. — *end note*]
54
+
55
+ Any type `C` that meets the sequence container requirements
56
+ [[sequence.reqmts]] can be used to instantiate `flat_multimap`, as long
57
+ as `C::iterator` meets the *Cpp17RandomAccessIterator* requirements and
58
+ invocations of member functions `C::size` and `C::max_size` do not exit
59
+ via an exception. In particular, `vector` [[vector]] and `deque`
60
+ [[deque]] can be used.
61
+
62
+ [*Note 3*: `vector<bool>` is not a sequence container. — *end note*]
63
+
64
+ The program is ill-formed if `Key` is not the same type as
65
+ `KeyContainer::value_type` or `T` is not the same type as
66
+ `MappedContainer::value_type`.
67
+
68
+ The effect of calling a constructor that takes both `key_container_type`
69
+ and `mapped_container_type` arguments with containers of different sizes
70
+ is undefined.
71
+
72
+ The effect of calling a constructor or member function that takes a
73
+ `sorted_equivalent_t` argument with a container, containers, or range
74
+ that are not sorted with respect to `key_comp()` is undefined.
75
+