Skip to content
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

Suggestion: replace alternative tokens for !, && and || with their symbols #1652

Closed
NotAPenguin0 opened this issue Jun 24, 2019 · 6 comments
Closed
Labels
solution: invalid the issue is not related to the library

Comments

@NotAPenguin0
Copy link

Title explains the issue. The usage of and, or, and not instead of &&, || and ! has caused more compiler errors and headscratching for me than it adds to the readability of the code.

@nlohmann
Copy link
Owner

Thanks for suggesting, but I like this. Why does it bother you how the library‘s internal logic is expressed?

@NotAPenguin0
Copy link
Author

When compiling using the latest release from the master branch today, clang 7 threw about 90 compiler errors at me which weren't understandable at all. Turns out replacing the alternative tokens with the symbols fixed the problem.

@gregmarr
Copy link
Contributor

Sounds like either a compiler bug or something in your environment is doing something illegal with the preprocessor. These are reserved words in C++ and can't be redefined. Do you have a small sample program that shows the errors?

@nlohmann
Copy link
Owner

It really sounds like a bug. We use Clang 7 in our CI via Travis, and also include <ciso646> for compilers that have issues with these operators like MSVC.

@NotAPenguin0
Copy link
Author

I don't know what caused it. If this issue is only present in my setup it's fine to leave it like this (I just ran a simple find-replace on the include to fix it for myself).

@nlohmann
Copy link
Owner

I'm closing this as it is unrelated to the library. Feel free to check back if you found the reason why your compiler complained about the operators.

@nlohmann nlohmann added the solution: invalid the issue is not related to the library label Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

3 participants