Skip to content

Commit 366822f

Browse files
authored
Fix cast of char8_t to char. Has to use reinterpret_cast.
1 parent c1b003f commit 366822f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

01-string-and-character-literals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ The following table lists C++ types, sizes, target encodings, literals and objec
156156
| char32_t | 32 | UTF-32 | U"abcd" | U'a' | UR"(abcd)" | u32string | n/a | no |
157157
| wchar_t | 16/32 | n/a + | L"abcd" | L'a' | LR"(abcd)" | wstring | wcout/wcerr | no |
158158

159-
&#42; An explicit cast to type `char` in `operator<<` may be required when using `cout`/`cerr`, for example: `cout << static_cast<char>(u8"Hello \u20AC!\n");`.
159+
&#42; An explicit cast to type `char` in `operator<<` may be required when using `cout`/`cerr`, for example: `cout << reinterpret_cast<const char*>(u8"Hello \u20AC!\n");`.
160160

161161
&#43; The `wchar_t` encoding and streams under Windows are 16-bit and support UTF-16.
162162

0 commit comments

Comments
 (0)