-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Vs14 fixes #105
Vs14 fixes #105
Conversation
MSVC will try to build json object from value_t and use another operator<
C++11 allows unions to have members with non-trivial constructors. VS2015 RC now supports this according to the feature table at http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx When you use types with non-trivial constructors and destructors in the union, you need to do more management of the union to change the active member, manually calling the destructor on the previous active member and placement new on the new active member. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf |
I know this wasn't first introduced in this commit, but this shouldn't use __basic_json as a typedef. Identifiers that start with two underscores are reserved to the C++ implementation (compiler and standard library). That should be renamed to something else, like basic_json_t. |
- additionally, switch off optimization flags to maybe allow build to complete on AppVeyor
Hi @kepkin, thanks a lot for the PR! |
Hey @gregmarr, you are right with About the union: I applied @kepkin's change to a
However, in the code, we never change the active member. |
If you're fine with it being a struct, that's probably the easiest path. Otherwise you have to be sure to manually construct the objects, and that's probably going to be difficult cross-platform. |
Hi @kepkin again, I have a question with respect to CMake, msbuild, and Appveyor you may help me with: You reported that Appveyor times out when it tries to compile the unit tests. That is very unfortunate but they offer 100% coverage, it would be nice to at least compile them with MSVC to avoid regressions. In the Do you have an idea how to influence this? Or whether there are different ways to make Appveyor compile the code? |
\o/ https://ci.appveyor.com/project/nlohmann/json/build/517 THANKS A LOT! |
Well, that's it. Everything you need to make it compile and fully work under MSVC 2015.
I'm afraid Appveyor won't be able to build it, as it required to much resource to build
unit.cpp
in release mode.