From Jason Turner

[unord.map.elem]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp49ianijj/{from.md → to.md} +30 -4
tmp/tmp49ianijj/{from.md → to.md} RENAMED
@@ -1,26 +1,52 @@
1
  #### Element access <a id="unord.map.elem">[[unord.map.elem]]</a>
2
 
3
  ``` cpp
4
- mapped_type& operator[](const key_type& k);
5
  ```
6
 
7
  *Effects:* Equivalent to: `return try_emplace(k).first->second;`
8
 
9
  ``` cpp
10
- mapped_type& operator[](key_type&& k);
11
  ```
12
 
13
  *Effects:* Equivalent to:
14
  `return try_emplace(std::move(k)).first->second;`
15
 
16
  ``` cpp
17
- mapped_type& at(const key_type& k);
18
- const mapped_type& at(const key_type& k) const;
 
 
 
 
 
 
 
 
 
 
19
  ```
20
 
21
  *Returns:* A reference to `x.second`, where `x` is the (unique) element
22
  whose key is equivalent to `k`.
23
 
24
  *Throws:* An exception object of type `out_of_range` if no such element
25
  is present.
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #### Element access <a id="unord.map.elem">[[unord.map.elem]]</a>
2
 
3
  ``` cpp
4
+ constexpr mapped_type& operator[](const key_type& k);
5
  ```
6
 
7
  *Effects:* Equivalent to: `return try_emplace(k).first->second;`
8
 
9
  ``` cpp
10
+ constexpr mapped_type& operator[](key_type&& k);
11
  ```
12
 
13
  *Effects:* Equivalent to:
14
  `return try_emplace(std::move(k)).first->second;`
15
 
16
  ``` cpp
17
+ template<class K> constexpr mapped_type& operator[](K&& k);
18
+ ```
19
+
20
+ *Constraints:* The *qualified-id*s `Hash::is_transparent` and
21
+ `Pred::is_transparent` are valid and denote types.
22
+
23
+ *Effects:* Equivalent to:
24
+ `return try_emplace(std::forward<K>(k)).first->second;`
25
+
26
+ ``` cpp
27
+ constexpr mapped_type& at(const key_type& k);
28
+ constexpr const mapped_type& at(const key_type& k) const;
29
  ```
30
 
31
  *Returns:* A reference to `x.second`, where `x` is the (unique) element
32
  whose key is equivalent to `k`.
33
 
34
  *Throws:* An exception object of type `out_of_range` if no such element
35
  is present.
36
 
37
+ ``` cpp
38
+ template<class K> constexpr mapped_type& at(const K& k);
39
+ template<class K> constexpr const mapped_type& at(const K& k) const;
40
+ ```
41
+
42
+ *Constraints:* The *qualified-id*s `Hash::is_transparent` and
43
+ `Pred::is_transparent` are valid and denote types.
44
+
45
+ *Preconditions:* The expression `find(k)` is well-formed and has
46
+ well-defined behavior.
47
+
48
+ *Returns:* A reference to `find(k)->second`.
49
+
50
+ *Throws:* An exception object of type `out_of_range` if
51
+ `find(k) == end()` is `true`.
52
+