From Jason Turner

[flat.map.access]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpz0dajwx_/{from.md → to.md} +57 -0
tmp/tmpz0dajwx_/{from.md → to.md} RENAMED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Access <a id="flat.map.access">[[flat.map.access]]</a>
2
+
3
+ ``` cpp
4
+ mapped_type& operator[](const key_type& x);
5
+ ```
6
+
7
+ *Effects:* Equivalent to: `return try_emplace(x).first->second;`
8
+
9
+ ``` cpp
10
+ mapped_type& operator[](key_type&& x);
11
+ ```
12
+
13
+ *Effects:* Equivalent to:
14
+ `return try_emplace(std::move(x)).first->second;`
15
+
16
+ ``` cpp
17
+ template<class K> mapped_type& operator[](K&& x);
18
+ ```
19
+
20
+ *Constraints:* The *qualified-id* `Compare::is_transparent` is valid and
21
+ denotes a type.
22
+
23
+ *Effects:* Equivalent to:
24
+ `return try_emplace(std::forward<K>(x)).first->second;`
25
+
26
+ ``` cpp
27
+ mapped_type& at(const key_type& x);
28
+ const mapped_type& at(const key_type& x) const;
29
+ ```
30
+
31
+ *Returns:* A reference to the `mapped_type` corresponding to `x` in
32
+ `*this`.
33
+
34
+ *Throws:* An exception object of type `out_of_range` if no such element
35
+ is present.
36
+
37
+ *Complexity:* Logarithmic.
38
+
39
+ ``` cpp
40
+ template<class K> mapped_type& at(const K& x);
41
+ template<class K> const mapped_type& at(const K& x) const;
42
+ ```
43
+
44
+ *Constraints:* The *qualified-id* `Compare::is_transparent` is valid and
45
+ denotes a type.
46
+
47
+ *Preconditions:* The expression `find(x)` is well-formed and has
48
+ well-defined behavior.
49
+
50
+ *Returns:* A reference to the `mapped_type` corresponding to `x` in
51
+ `*this`.
52
+
53
+ *Throws:* An exception object of type `out_of_range` if no such element
54
+ is present.
55
+
56
+ *Complexity:* Logarithmic.
57
+