mirror of
https://github.com/nlohmann/json.git
synced 2026-10-18 12:08:12 +00:00
Both macros select between definitions of the same inline functions, so translation units that disagree on them violated the ODR. Like the other ABI-affecting macros, they now add a tag to the inline namespace (_vns and _vssse3), and the docs replace the "Define consistently" warning with the usual ABI compatibility note. From gregmarr's review of #5628. nlohmann_json.natvis covers twice as many tags now, so it lists four times as many namespaces (14.7 MB instead of 3.4 MB). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
1.3 KiB
1.3 KiB
NLOHMANN_JSON_NAMESPACE
#define NLOHMANN_JSON_NAMESPACE /* value */
This macro evaluates to the full name of the nlohmann namespace.
Default definition
The default value consists of the root namespace (nlohmann) and an inline ABI namespace. See
nlohmann Namespace for details.
When the macro is not defined, the library will define it to its default value. Overriding this value has no effect on the library.
Examples
??? example
The example shows how to use `NLOHMANN_JSON_NAMESPACE` instead of just `nlohmann`, as well as how to output the value
of `NLOHMANN_JSON_NAMESPACE`.
```cpp
--8<-- "examples/nlohmann_json_namespace.cpp"
```
Output:
```json
--8<-- "examples/nlohmann_json_namespace.output"
```
See also
Version history
- Added in version 3.11.0. Changed inline namespace name in version 3.11.2. Added the ABI tag
_dpin version 3.12.0, and the ABI tags_bics,_psp,_snul,_sbu8,_ekmo,_vns, and_vssse3in version 3.13.0; seenlohmannNamespace.