Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for u8 string literal changes in c++20 #34

Closed
revel8n opened this issue Jan 9, 2020 · 4 comments
Closed

Support for u8 string literal changes in c++20 #34

revel8n opened this issue Jan 9, 2020 · 4 comments

Comments

@revel8n
Copy link
Contributor

revel8n commented Jan 9, 2020

In c++20 u8 string literals no longer default to const char[N], instead becoming const char8_t[N].

Since there are currently no explicit conversions to or from char8_t*, u8string, etc., examples like the one proposed in the readme (using u8"" string literals) no longer compile successfully when configured to use the latest standard.

the __cpp_char8_t and __cpp_lib_char8_t macros could possibly be used to determine support for the extended types.

@DuffsDevice
Copy link
Owner

Hello,
Thank you for your heads-up regarding char8_t in C++20.
I'll implement the changes you suggest 👍, it might take me a week or so.
Best Regards,
Jakob

@DuffsDevice
Copy link
Owner

Hi again,
as it turns out, I am so busy with university, I won't make it within two weeks or so. If you like, please submit a pull request implementing the necessary changes.
Thanks,
Jakob
PS: I will still try to do it as soon as I get the chance to.

@DuffsDevice
Copy link
Owner

DuffsDevice commented Jun 3, 2020

Hi there,

I just committed a draft for C++20 support 😃 The way it works is that beyond C++17, the underlying data type char is entirely replaced by char8_t. Could you make sure, whether that is what you intend and whether it compiles under C++20?
(I did not have a C++20-able compiler to check it against).

All the Best,
Jakob

@DuffsDevice
Copy link
Owner

I'm gonna close it for now. Feel free to reopen the ticket in case you need to :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants