From Jason Turner

[map.access]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpe9b2a860/{from.md → to.md} +32 -4
tmp/tmpe9b2a860/{from.md → to.md} RENAMED
@@ -1,28 +1,56 @@
1
  #### Element access <a id="map.access">[[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
- mapped_type& at(const key_type& x);
18
- const mapped_type& at(const key_type& x) const;
 
 
 
 
 
 
 
 
 
 
19
  ```
20
 
21
  *Returns:* A reference to the `mapped_type` corresponding to `x` in
22
  `*this`.
23
 
24
  *Throws:* An exception object of type `out_of_range` if no such element
25
  is present.
26
 
27
  *Complexity:* Logarithmic.
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #### Element access <a id="map.access">[[map.access]]</a>
2
 
3
  ``` cpp
4
+ constexpr mapped_type& operator[](const key_type& x);
5
  ```
6
 
7
  *Effects:* Equivalent to: `return try_emplace(x).first->second;`
8
 
9
  ``` cpp
10
+ constexpr 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> constexpr 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
+ constexpr mapped_type& at(const key_type& x);
28
+ constexpr 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> constexpr mapped_type& at(const K& x);
41
+ template<class K> constexpr 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 `find(x)->second`.
51
+
52
+ *Throws:* An exception object of type `out_of_range` if
53
+ `find(x) == end()` is `true`.
54
+
55
+ *Complexity:* Logarithmic.
56
+