Files
json/docs/mkdocs/docs/api/macros/nlohmann_json_namespace.md
T
Niels Lohmann c7a9780936 Add ABI tags for JSON_DISABLE_STREAM_BULK_SCAN and JSON_DISABLE_UNLOCKED_FILE_IO
Both macros select between two definitions of an input adapter, so
translation units compiled with different settings violated the ODR when
linked together. Like the other ABI-affecting macros, they now append a
tag to the inline namespace: _dsbs and _dufio. Their defaults move to
abi_macros.hpp so that json_fwd.hpp sees them, and the natvis file is
regenerated for the new namespaces.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-10-17 08:29:46 +02:00

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 _dp in version 3.12.0, and the ABI tags _bics, _psp, _snul, _sbu8, _ekmo, _dsbs, and _dufio in version 3.13.0; see nlohmann Namespace.