From Jason Turner

[diff.cpp20.expr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpf3up146t/{from.md → to.md} +24 -0
tmp/tmpf3up146t/{from.md → to.md} RENAMED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### [[expr]]: expressions <a id="diff.cpp20.expr">[[diff.cpp20.expr]]</a>
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
+