#define JSON_HAS_RANGES /* value */
This macro indicates whether the standard library has any support for ranges. Implies support for concepts. Possible values are 1 when supported or 0 when unsupported.
The default value is detected based on the preprocessor macro __cpp_lib_ranges.
When the macro is not defined, the library will define it to its default value.
Known compiler/stdlib exclusions
Even when the feature-test macro __cpp_lib_ranges indicates ranges support is available, the library disables it on the following incomplete or broken toolchains:
<ranges> header has a syntax error; issue #4440)enable_borrowed_range variable-template syntax triggers a parse error under these two toolkit versions; fixed in CUDA 12.2; issue #3907)If JSON_HAS_RANGES is 0 despite __cpp_lib_ranges being defined, one of the exclusions above likely applies to your toolchain.
Example
The code below forces the library to enable support for ranges:
#define JSON_HAS_RANGES 1 #include <nlohmann/json.hpp> ...