1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-30 15:43:01 +04:00
Files
json/api/macros/json_has_three_way_comparison.md
2026-07-08 18:19:46 +00:00

33 lines
744 B
Markdown

# JSON_HAS_THREE_WAY_COMPARISON
```cpp
#define JSON_HAS_THREE_WAY_COMPARISON /* value */
```
This macro indicates whether the compiler and standard library support 3-way comparison.
Possible values are `1` when supported or `0` when unsupported.
## Default definition
The default value is detected based on the preprocessor macros `#!cpp __cpp_impl_three_way_comparison`
and `#!cpp __cpp_lib_three_way_comparison`.
When the macro is not defined, the library will define it to its default value.
## Examples
??? example
The code below forces the library to use 3-way comparison:
```cpp
#define JSON_HAS_THREE_WAY_COMPARISON 1
#include <nlohmann/json.hpp>
...
```
## Version history
- Added in version 3.11.0.