MSVC: make #4526 pass (use #if for optional) - fixes #3859; re-amalgamate
Changes made
- pulled pr #4526 and amalgamated
- merged into develop and fixed conflicts, kept most recent version of from_json.hpp (removed extra JSON_USE_IMPLICIT_CONVERSIONS that broke C++11 builds).
- Regenerated single-header files via the amalgamation target.
Existing issue is referenced:
- https://github.com/nlohmann/json/issues/3859
How I tested
- Windows: VS 2019, x64 toolset, CMake
- -DJSON_BuildTests=ON
- Built and ran tests (Debug/Release).
Amalgamation
- The source code is amalgamated by running
py -3 tools\amalgamate\amalgamate.py.
I don't understand what's happening with this PR. It is not showing the change in the original file, but it is showing it in the amalgamated file, and there's no complaint about that from the checks. Also strange, there are only 5 checks.
@gregmarr i think most workflows are awaiting approval because it is my first contribution, and the changes in the source files has been made in previous commits, the latest commits just amalgamated the headers, that's why at first it may look like only the amalgamated files are modified
🔴 Amalgamation check failed! 🔴
The source code has not been amalgamated. @chelseadzdr Please read and follow the Contribution Guidelines.
coverage: 99.191%. remained the same when pulling 4c55fcb54ab60a7366c682ea417007d29f3b63b5 on chelseadzdr:fix-msvc-optional into 4f8ee1d5e0117ab8d3c805655649386f323f868f on nlohmann:develop.
This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions!
There are whitespace changes in the amalgamated header, but no changes in any of the other headers, so the base commit was not properly amalgamated (unlikely) or there's a problem with your setup. The change in from_json in the original PR is no longer needed because the #ifdef in question was removed as incorrect.
As for the test, it looks like some of the tests require checking JSON_USE_IMPLICIT_CONVERSIONS and some don't.
I think you might need to start over with a single fresh commit that just fixes the test, due to the DCO checks, and the older commits that aren't signed off.