The C++20’s u8/char8_t Backward-Compatibility Fiasco

8 points by raymii


dilawar

C++ has grown too big. They backward compatibility obsession is admirable but it will lead to windows like inflated object. New things are added, old are not removed. Bloat after bloat.

fanf

There’s similar breakage in C:

In C17 a u8"str" string literal has elements of type char which is usually signed. (There are no u8'c' character constants in C17.)

In C23 a u8'c' character constant has type char8_t aka unsigned char, and (despite the name and the specification trying to suggest otherwise) can only represent ASCII characters. Elements of a u8"str" string literal also now have type char8_t which is usually a different signedness from a C17 u8"str".

Annex M of C23 doesn’t mention the change of element type.