-
-
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
Fix/basic json conversion #986
Fix/basic json conversion #986
Conversation
Can one of the admins verify this patch? |
b5d4693
to
d5216ec
Compare
In the end I've adopted the same behavior that can be found in the rest of the code (i.e. |
@nlohmann Apparently it does not change anything coverage-wise. I did not see a test converting from a |
The |
Hmm, so trying to explicitly convert a |
No. It should just be copied as is. |
Oh right, converting to something else than |
Before this patch, `basic_json` types with different template arguments were treated as `CompatibleArrayType`. Which sometimes leads to recursive calls and stack overflows. This patch adds a constructor and a `get` overload to deal with different `basic_json` types.
d5216ec
to
8711ec6
Compare
What is the state of this PR? Is it ready to merge? |
Yep, apparently it did fix #977. |
OK. I'll check whether it also closes #972 tonight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks a lot @theodelrieu ! |
I added a regression test (not yet committed), and got the following warning when compiled with GCC and maximal warnings:
This is a false positive, right? |
Either that or your serializer is missing noexcept constraints. Could you post the serializer code? |
This is saying that we should mark |
@gregmarr was right - adding |
Attempt to fix #977.
Details can be found in the commit message body.
There is a
FIXME
left in the code about thevalue_t::discarded
flag. I don't know in which cases this flag can be encountered.Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.