-
Notifications
You must be signed in to change notification settings - Fork 142
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 C++20 and std::u8string #104
Comments
Yes, I know that problem... The other day, I did the same thing as you did and encountered the same error. I'm also not sure what is the best way to deal with it. Anyway, thank you for reporting this. The priority increased. There can be several options. One is, as you suggested, to add a type alias to switch the implementation of Basically, I want to provide users the flexibility and controllability. So I prefer the second option in the previous paragraph, template. But currently, I've not done anything about this because the priority was low. Also, since I recognized the problem only a few days ago, I'm still not so confident about the solution. There could be another, better idea, not sure... |
I dug up some information on this and it looks like nobody is happy about the breaking conversions for
|
Would there be a way to also support reading to wstring instead of string, and serializing from wstring as UTF-8? |
Sorry for the late response. But we don't have a plan to serialize into/deserialize from You can use compiler's builtin or OS API for convertion between an array of |
No problem.
I have found much better C++ parser for TOML in the meantime, which supports all conversions from/to STL containers, and whose author is more open-minded when it comes to feature requests which would make their library useful for more people.
|
Nice. Most of the libraries are provided as is and toml11 is no exception. I hope you could solve your problem. |
Coming back to the original problem, I have added a workaround and now both And thank you very much jwillikers for the surveying the situation. |
I understand that very well, the only reason I ever asked about I also understand that
Yes, I have solved it by switching to toml++.
I understand that as well. However, people sometimes need to get their own work done too. That's usually why they look for a library someone else wrote in the first place -- to avoid having to implement stuff in a domain they aren't familiar with under time constraints of their own project or work assignment. Sorry for the slight off-topic, and I apologize if I came through as disrespectful with my previous response. |
When compiling for C++20, the following error occurs:
It looks like the introduction of std::u8string is causing problems for conversions between
char8_t
andstd::string
types.I'm not sure the best way to handle this. My first though is to create a type alias which can be configured to
std::string
for C++11, C++14, and C++17 orstd::u8string
for C++20 and newer. That brings up an important question. Should the API for toml11 only supportstd::u8string
for C++20 and beyond?The text was updated successfully, but these errors were encountered: