tmp/tmp5cjcl4p2/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,16 @@
|
|
| 1 |
-
### [[dcl
|
| 2 |
|
| 3 |
**Change:** UTF-8 string literals may initialize arrays of `char` or
|
| 4 |
`unsigned char`. **Rationale:** Compatibility with previously written
|
| 5 |
code that conformed to previous versions of this document. **Effect on
|
| 6 |
original feature:** Arrays of `char` or `unsigned char` may now be
|
| 7 |
initialized with a UTF-8 string literal. This can affect initialization
|
| 8 |
that includes arrays that are directly initialized within class types,
|
| 9 |
-
typically aggregates.
|
|
|
|
|
|
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
struct A {
|
| 13 |
char8_t s[10];
|
| 14 |
};
|
|
@@ -22,5 +24,7 @@ void f(B);
|
|
| 22 |
int main() {
|
| 23 |
f({u8""}); // ambiguous
|
| 24 |
}
|
| 25 |
```
|
| 26 |
|
|
|
|
|
|
|
|
|
| 1 |
+
### [[dcl]]: declarations <a id="diff.cpp20.dcl">[[diff.cpp20.dcl]]</a>
|
| 2 |
|
| 3 |
**Change:** UTF-8 string literals may initialize arrays of `char` or
|
| 4 |
`unsigned char`. **Rationale:** Compatibility with previously written
|
| 5 |
code that conformed to previous versions of this document. **Effect on
|
| 6 |
original feature:** Arrays of `char` or `unsigned char` may now be
|
| 7 |
initialized with a UTF-8 string literal. This can affect initialization
|
| 8 |
that includes arrays that are directly initialized within class types,
|
| 9 |
+
typically aggregates.
|
| 10 |
+
|
| 11 |
+
[*Example 1*:
|
| 12 |
|
| 13 |
``` cpp
|
| 14 |
struct A {
|
| 15 |
char8_t s[10];
|
| 16 |
};
|
|
|
|
| 24 |
int main() {
|
| 25 |
f({u8""}); // ambiguous
|
| 26 |
}
|
| 27 |
```
|
| 28 |
|
| 29 |
+
— *end example*]
|
| 30 |
+
|