-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
VS2015 compile fail #260
Comments
I'll have a look into this. Just to make sure:
I'm asking because AppVeyor could execute all tests successfully (https://ci.appveyor.com/project/nlohmann/json) with MSVC 19.0.23918.0. |
I can confirm that this does happen with the most recent commit in VS2015. This is due to the fact that Windows defines max() and min() as macros in windows.h. You can avoid the macro expansion by surrounding numeric_limits::max in extra parentheses, like so: |
You can also add the following to prevent them from being defined, as long as none of your code requires them to be defined, or you can update your code. |
Many thanks to all. I will test right the way |
@nlohmann I'm using VS Community 2015 Version 14.0.23107.0 D14REL and it is the most recent version from the develop branch |
@Epidal your suggestion fix the issues. Thx |
You need to define that before including any Windows headers. |
I committed the fix, but I won't merge it before Travis builds it (there seem to be problems with the LLVM's apt server...) |
Finally merged commit b508d1f to develop branch. |
Hi all,
I'm trying to import json.hpp into my project. When compiling, an error came out and pointed to line 8500 "max = static_cast<uint64_t>(std::numeric_limits<number_integer_t>::max()) + 1;"
Error Code: C2589 '(': illegal token on right side of '::'
The text was updated successfully, but these errors were encountered: