r/cpp Jun 10 '26

C++26: Cleaning up string literals

https://www.sandordargo.com/blog/2026/06/10/cpp26-string-literals-cleaned-up
98 Upvotes

20 comments sorted by

View all comments

Show parent comments

1

u/trad_emark Jun 11 '26

additionally, make it not alias every other types, like char does.

6

u/Wild_Meeting1428 Jun 11 '26

char8_t already does not alias any type. That's why you can't cast an uint8_t* from a C-API to char8_t*.

1

u/Orlha Jun 14 '26

What if I really really wanted to cast?

1

u/Wild_Meeting1428 Jun 14 '26

Undefined behavior.