From Jason Turner

[unord.set.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbfllpwhf/{from.md → to.md} +27 -0
tmp/tmpbfllpwhf/{from.md → to.md} RENAMED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Modifiers <a id="unord.set.modifiers">[[unord.set.modifiers]]</a>
2
+
3
+ ``` cpp
4
+ template<class K> constexpr pair<iterator, bool> insert(K&& obj);
5
+ template<class K> constexpr iterator insert(const_iterator hint, K&& obj);
6
+ ```
7
+
8
+ *Constraints:* The *qualified-id*s `Hash::is_transparent` and
9
+ `Pred::is_transparent` are valid and denote types. For the second
10
+ overload, `is_convertible_v<K&&, const_iterator>` and
11
+ `is_convertible_v<K&&, iterator>` are both `false`.
12
+
13
+ *Preconditions:* `value_type` is *Cpp17EmplaceConstructible* into
14
+ `unordered_set` from `std::forward<K> (obj)`.
15
+
16
+ *Effects:* If the set already contains an element that is equivalent to
17
+ `obj`, there is no effect. Otherwise, let `h` be `hash_function()(obj)`.
18
+ Constructs an object `u` of type `value_type` with
19
+ `std::forward<K>(obj)`. If `hash_function()(u) != h || contains(u)` is
20
+ `true`, the behavior is undefined. Inserts `u` into `*this`.
21
+
22
+ *Returns:* For the first overload, the `bool` component of the returned
23
+ pair is `true` if and only if the insertion took place. The returned
24
+ iterator points to the set element that is equivalent to `obj`.
25
+
26
+ *Complexity:* Average case constant, worst case linear.
27
+