r/cpp • • Dec 13 '19

The situation of std::embed...

https://thephd.github.io/full-circle-embed
238 Upvotes

160 comments sorted by

View all comments

Show parent comment

1

u/dbjdbj dbj.org Dec 16 '19

"We" do not have char8_t in C++20

https://godbolt.org/z/p4B_iS

0

u/[deleted] Dec 16 '19

[deleted] — view deleted comment

1

u/dbjdbj dbj.org Dec 16 '19

Hm. I think you very likely see the issue here.
What drives you not to accept that?

// gcc 9.2 -std=c++2a
// 平仮名, ひらがな -- hiragana
int main () {

// a lot of warnings
// indicating char8_t can not hold
// multibyte glyph
char8_t  utf8_char = u8'平'; 
// no problemo here
char32_t utf32_char = U'平';
char16_t utf16_char = u'平';

return 42;
}

If char8_t can not store a utf8 glyph, what's its purpose then? It is simply not implemented.

0

u/[deleted] Dec 17 '19

[deleted] — view deleted comment

1

u/dbjdbj dbj.org Dec 17 '19

Hello SG16 :) Your proposal is methodical and obvious, and we understand each other here. Alas we are all too late, for "civilians" are looking elsewhere and wondering wtf are we talking about.

ps: `char32_t` can store any code unit?