From Jason Turner

[diff.cpp20.expr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphmbz5hp0/{from.md → to.md} +10 -2
tmp/tmphmbz5hp0/{from.md → to.md} RENAMED
@@ -2,23 +2,31 @@
2
 
3
  **Change:** Change move-eligible *id-expression*s from lvalues to
4
  xvalues. **Rationale:** Simplify the rules for implicit move. **Effect
5
  on original feature:** Valid C++20 code that relies on a returned
6
  *id-expression*’s being an lvalue may change behavior or fail to
7
- compile. For example:
 
 
8
 
9
  ``` cpp
10
  decltype(auto) f(int&& x) { return (x); } // returns int&&; previously returned int&
11
  int& g(int&& x) { return x; } // ill-formed; previously well-formed
12
  ```
13
 
 
 
14
  **Change:** Change the meaning of comma in subscript expressions.
15
  **Rationale:** Enable repurposing a deprecated syntax to support
16
  multidimensional indexing. **Effect on original feature:** Valid C++20
17
  code that uses a comma expression within a subscript expression may fail
18
- to compile. For example:
 
 
19
 
20
  ``` cpp
21
  arr[1, 2] // was equivalent to arr[(1, 2)],
22
  // now equivalent to arr.operator[](1, 2) or ill-formed
23
  ```
24
 
 
 
 
2
 
3
  **Change:** Change move-eligible *id-expression*s from lvalues to
4
  xvalues. **Rationale:** Simplify the rules for implicit move. **Effect
5
  on original feature:** Valid C++20 code that relies on a returned
6
  *id-expression*’s being an lvalue may change behavior or fail to
7
+ compile.
8
+
9
+ [*Example 1*:
10
 
11
  ``` cpp
12
  decltype(auto) f(int&& x) { return (x); } // returns int&&; previously returned int&
13
  int& g(int&& x) { return x; } // ill-formed; previously well-formed
14
  ```
15
 
16
+ — *end example*]
17
+
18
  **Change:** Change the meaning of comma in subscript expressions.
19
  **Rationale:** Enable repurposing a deprecated syntax to support
20
  multidimensional indexing. **Effect on original feature:** Valid C++20
21
  code that uses a comma expression within a subscript expression may fail
22
+ to compile.
23
+
24
+ [*Example 2*:
25
 
26
  ``` cpp
27
  arr[1, 2] // was equivalent to arr[(1, 2)],
28
  // now equivalent to arr.operator[](1, 2) or ill-formed
29
  ```
30
 
31
+ — *end example*]
32
+