mirror of
https://github.com/nlohmann/json.git
synced 2026-10-29 00:55:44 +00:00
1.5 KiB
1.5 KiB
NLOHMANN_JSON_NAMESPACE_NO_VERSION
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION /* value */
If defined to 1, the version component is omitted from the inline namespace. See nlohmann Namespace for details.
Default definition
The default value is 0.
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
When the macro is not defined, the library will define it to its default value.
Examples
Example
The example shows how to use NLOHMANN_JSON_NAMESPACE_NO_VERSION to disable the version component of the inline namespace.
#include <iostream>
#define NLOHMANN_JSON_NAMESPACE_NO_VERSION 1
#include <nlohmann/json.hpp>
// 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) << '\n';
}
Output:
nlohmann::json_abi
See also
nlohmannNamespace - how the library's namespace is defined and versionedNLOHMANN_JSON_NAMESPACE- macro expanding to the library namespaceNLOHMANN_JSON_NAMESPACE_BEGIN, NLOHMANN_JSON_NAMESPACE_END- macros to open and close the library namespace- Supported Macros - guide to all supported macros
Version history
- Added in version 3.11.2.