mirror of
https://github.com/nlohmann/json.git
synced 2026-10-13 17:57: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
@@ -22,13 +22,28 @@ the library.
|
||||
of `NLOHMANN_JSON_NAMESPACE`.
|
||||
|
||||
```cpp
|
||||
--8<-- "examples/nlohmann_json_namespace.cpp"
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
// possible use case: use NLOHMANN_JSON_NAMESPACE instead of nlohmann
|
||||
using json = NLOHMANN_JSON_NAMESPACE::json;
|
||||
|
||||
// macro needed to output the NLOHMANN_JSON_NAMESPACE as string literal
|
||||
#define Q(x) #x
|
||||
#define QUOTE(x) Q(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << QUOTE(NLOHMANN_JSON_NAMESPACE) << std::endl;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
--8<-- "examples/nlohmann_json_namespace.output"
|
||||
nlohmann::json_abi_v3_12_0
|
||||
|
||||
```
|
||||
|
||||
## See also
|
||||
@@ -38,4 +53,6 @@ the library.
|
||||
|
||||
## Version history
|
||||
|
||||
- Added in version 3.11.0. Changed inline namespace name in version 3.11.2.
|
||||
- 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`, and `_ekmo` in version 3.13.0; see
|
||||
[`nlohmann` Namespace](../../features/namespace.md#structure).
|
||||
Reference in new issue
Block a user