logoalt Hacker News

vitautyesterday at 11:44 PM1 replyview on HN

Somewhat notable is that `char8_t` is banned with very reasonable motivation that applies to most codebases:

> Use char and unprefixed character literals. Non-UTF-8 encodings are rare enough in Chromium that the value of distinguishing them at the type level is low, and char8_t* is not interconvertible with char* (what ~all Chromium, STL, and platform-specific APIs use), so using u8 prefixes would obligate us to insert casts everywhere. If you want to declare at a type level that a block of data is string-like and not an arbitrary binary blob, prefer std::string[_view] over char*.


Replies

ChrisSDtoday at 12:01 AM

`char8_t` is probably one of the more baffling blunders of the standards committee.

show 1 reply