https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88508

--- Comment #4 from Frank Heckenbach <f.heckenb...@fh-soft.de> ---
(In reply to Jonathan Wakely from comment #3)

I don't think my description is "completely wrong". I'm basically saying the
same as you, in plain English.

char8_t was introduced as the preferred type for holding UTF-8 text, so this
clearly has to do with UTF-8. (And I say "text" intentionally -- single
characters are usually better represented as char32_t code points while
encodings such as UTF-8 are used for text.) Streams are the main tool for input
and output and formatting in the standard library, so a text type which does
not support input, output and formatting is indeed ridiculous.

And "imbue the stream with the relevant facets" is just techspeak for telling
the stream what the space character is (and possibly other things), like I
said.

Moreover, if streams don't support char8_t by default, they should clearly say
so (which should be easy these days with concepts, otherwise even with SFINAE)
instead of giving obscure errors about a bad cast where there is no cast.

Again, I'm not blaming gcc if the standard says so, so this discussion here is
probably a waste of time, but it might serve as a warning to other users, to
avoid falling into this trap like I did -- which is easy to fall into when u8""
literals are char8_t[] by default, and char8_t's stated purpose is to hold
UTF-8.

Reply via email to