From Jason Turner

[flat.set.overview]

Diff to HTML by rtfpessoa

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