Files
json/docs/mkdocs/docs/api/macros/nlohmann_json_namespace.md
T
Niels Lohmann 621b1506eb Encode JSON_VIEW_NO_SIMD and JSON_VIEW_USE_SSSE3 in the ABI namespace
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>
2026-10-18 13:31:48 +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, _vns, and _vssse3 in version 3.13.0; see nlohmann Namespace.