-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
document that implicit js -> primitive conversion does not work for std::string::value_type and why #1052
Comments
This seems to be a duplicate of #276. |
Oh ok. Apologies; I looked at the open issues and went to see if I could reproduce it with HEAD, I did not look at the closed "wontfix" issues Is this documented? It didn't stand out to me when I went over the existing documentation. |
A good solution indeed is using #get(). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'd like to add a comment. When using GCC 7.2.0 the following code works perfectly:
When compiling the same code with GCC 8.0.1, it does not compile with the following error:
Of course using explicit conversion works flawlessly:
I thought I mention since 8.0.1 is out. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I expect to be able to convert from and to any C++ primitive type.
I can convert from and to json from basically any type but a plain "char". If trying to do so, I'm getting a compile error:
Conversion from and to similarly sized
signed char
andunsigned char
do work as expected, as do conversions from and toint8_t
anduint8_t
.See the following file:
uncomment the second to last line in
main()
to get the compile error.Compiled with
g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
onLinux 4.12.0-0.bpo.2-amd64 x86_64
invoked asg++ -Wextra -Wall -Werror -std=c++11 -I $NLOHMANN_JSON_SINGLE_INCLUDE_DIR -o minimal minimal.cpp
This is with
nlohmann-json commit 46ec2fddf8774af2f9368bf563dd6e32fa91d77e
Nope, I don't have a cmake 3.8 handy.
The text was updated successfully, but these errors were encountered: