-
-
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
Remove #include <ciso646> #2089
Comments
What do you mean? |
They are not in msvc without |
Indeed we include the header due to old MSVC versions. We should check if we can detect these versions with a macro (Hedley has a lot of them...) and only include it then. |
Related: #1782 |
Problem is this option does not depend on msvc version, that is, old project with permissive setting can be built with newest msvc and vice versa. AFAIK there's no macro to check it. But we can check build flags and set some macro ourselves. @nlohmann sounds good? |
@ArtemSarmini You are fast! I just wanted to let you know about the change and ask for your opinion. An alternative to this approach would be to detect C++20 and not try to include if C++20 is used. Would that be feasible? |
Again this flag does not depend on C++ version. |
But in C++20, the header disappears, so I would expect that alternative operator representations must then work without that header. Or to put it differently: is there a minimal version that does not need |
No idea. I'll try to ask STL about that. But I guess microsoft assumes projects either use old msvc version or have the flag off.
As I understand it there's no such version. And it doesn't disappear, it is deprecated and (according to comitee strategy) will be removed in 23. That said, vendors may leave it for compatibilty. We still should not use it though. |
It's deprecated since C++17 and will be removed in C++20 (see https://en.cppreference.com/w/cpp/header/ciso646, http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2131r0.html). So basically #if __cplusplus <= 201703L
#include <ciso646> // and, not, or
#endif should do the job. |
I was wrong about version. |
@ArtemSarmini Any news on this? Any comment on https://github.com/nlohmann/json/blob/8c2b26de4a9886751b8c7d88b788dc33c515f9f0/include/nlohmann/detail/boolean_operators.hpp? |
Was a bit of a surprise that 'or' and 'and' work in our code base and tracked it down to files that include nlohmann/json. Also note this header is going away in C++20.
The text was updated successfully, but these errors were encountered: