mirror of
https://github.com/nlohmann/json.git
synced 2026-10-14 02:07:14 +00:00
deploy: 40a62947d3
This commit is contained in:
1 parent
79119509a9
commit
22fba27145
555 files changed
+17342
-1394
No files matched your search
@@ -0,0 +1,40 @@
|
||||
# JSON_HAS_RANGE_VIEW_CONVERSION
|
||||
|
||||
```
|
||||
#define JSON_HAS_RANGE_VIEW_CONVERSION /* value */
|
||||
```
|
||||
|
||||
This macro indicates whether a JSON array can be constructed directly from a C++20 range view (`std::ranges::view`), such as the result of `std::views::filter` or `std::views::transform`. Possible values are `1` when supported or `0` when unsupported.
|
||||
|
||||
## Default definition
|
||||
|
||||
The default value is `1` if [`JSON_HAS_RANGES`](https://json.nlohmann.me/api/macros/json_has_ranges/index.md) is `1` and the compiler is not MinGW (that is, `__MINGW32__` is not defined), and `0` otherwise.
|
||||
|
||||
When the macro is not defined, the library will define it to its default value.
|
||||
|
||||
Known compiler/stdlib exclusions
|
||||
|
||||
- **MinGW** -- disabled, because its `std::ranges` support is incomplete ([issue #4916](https://github.com/nlohmann/json/issues/4916)).
|
||||
- All toolchains for which [`JSON_HAS_RANGES`](https://json.nlohmann.me/api/macros/json_has_ranges/#default-definition) is disabled.
|
||||
|
||||
## Examples
|
||||
|
||||
Example
|
||||
|
||||
The code below forces the library to disable the conversion from range views:
|
||||
|
||||
```
|
||||
#define JSON_HAS_RANGE_VIEW_CONVERSION 0
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [JSON_HAS_RANGES](https://json.nlohmann.me/api/macros/json_has_ranges/index.md) - control `std::ranges` support
|
||||
- [Constructing from a C++20 range view](https://json.nlohmann.me/features/conversions/#putting-values-in) - usage of the feature
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 3.13.0 unreleased.
|
||||
Reference in new issue
Block a user