From Jason Turner

[map.access]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp97hrn40y/{from.md → to.md} +2 -19
tmp/tmp97hrn40y/{from.md → to.md} RENAMED
@@ -2,34 +2,17 @@
2
 
3
  ``` cpp
4
  T& operator[](const key_type& x);
5
  ```
6
 
7
- *Effects:* If there is no key equivalent to `x` in the map, inserts
8
- `value_type(x, T())` into the map.
9
-
10
- *Requires:* `key_type` shall be `CopyInsertable` and `mapped_type` shall
11
- be `DefaultInsertable` into `*this`.
12
-
13
- *Returns:* A reference to the `mapped_type` corresponding to `x` in
14
- `*this`.
15
-
16
- *Complexity:* Logarithmic.
17
 
18
  ``` cpp
19
  T& operator[](key_type&& x);
20
  ```
21
 
22
- *Effects:* If there is no key equivalent to `x` in the map, inserts
23
- `value_type(std::move(x), T())` into the map.
24
-
25
- *Requires:* `mapped_type` shall be `DefaultInsertable` into `*this`.
26
-
27
- *Returns:* A reference to the `mapped_type` corresponding to `x` in
28
- `*this`.
29
-
30
- *Complexity:* Logarithmic.
31
 
32
  ``` cpp
33
  T& at(const key_type& x);
34
  const T& at(const key_type& x) const;
35
  ```
 
2
 
3
  ``` cpp
4
  T& operator[](const key_type& x);
5
  ```
6
 
7
+ *Effects:* Equivalent to: `return try_emplace(x).first->second;`
 
 
 
 
 
 
 
 
 
8
 
9
  ``` cpp
10
  T& operator[](key_type&& x);
11
  ```
12
 
13
+ *Effects:* Equivalent to: `return try_emplace(move(x)).first->second;`
 
 
 
 
 
 
 
 
14
 
15
  ``` cpp
16
  T& at(const key_type& x);
17
  const T& at(const key_type& x) const;
18
  ```