TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ meta()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer, class BinaryType = std::vector<std::uint8_t>>
static JSON_HEDLEY_WARN_UNUSED_RESULT basic_json nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::meta ( )
inlinestatic

returns version information on the library

This function returns a JSON object with information about the library, including the version number and information on the platform and compiler.

Returns
JSON object holding version information
key description
compiler Information on the used compiler. It is an object with the following keys: c++ (the used C++ standard), family (the compiler family; possible values are clang, icc, gcc, ilecpp, msvc, pgcpp, sunpro, and unknown), and version (the compiler version).
copyright The copyright line for the library as string.
name The name of the library as string.
platform The used platform as string. Possible values are win32, linux, apple, unix, and unknown.
url The URL of the project as string.
version The version of the library. It is an object with the following keys: major, minor, and patch as defined by Semantic Versioning, and string (the version string).

@liveexample{The following code shows an example output of the meta() function.,meta}

@exceptionsafety Strong guarantee: if an exception is thrown, there are no changes to any JSON value.

@complexity Constant.

Since
2.1.0

Definition at line 18037 of file json.hpp.

18038 {
18039 basic_json result;
18040 result["copyright"] = "(C) 2013-2021 Niels Lohmann";
18041 result["name"] = "JSON for Modern C++";
18042 result["url"] = "https://github.com/nlohmann/json";
18043 result["version"]["string"] =
18044 std::to_string(NLOHMANN_JSON_VERSION_MAJOR) + "." +
18045 std::to_string(NLOHMANN_JSON_VERSION_MINOR) + "." +
18046 std::to_string(NLOHMANN_JSON_VERSION_PATCH);
18047 result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR;
18048 result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR;
18049 result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH;
18050#ifdef _WIN32
18051 result["platform"] = "win32";
18052#elif defined __linux__
18053 result["platform"] = "linux";
18054#elif defined __APPLE__
18055 result["platform"] = "apple";
18056#elif defined __unix__
18057 result["platform"] = "unix";
18058#else
18059 result["platform"] = "unknown";
18060#endif
18061#if defined(__ICC) || defined(__INTEL_COMPILER)
18062 result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}};
18063#elif defined(__clang__)
18064 result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}};
18065#elif defined(__GNUC__) || defined(__GNUG__)
18066 result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}};
18067#elif defined(__HP_cc) || defined(__HP_aCC)
18068 result["compiler"] = "hp"
18069#elif defined(__IBMCPP__)
18070 result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}};
18071#elif defined(_MSC_VER)
18072 result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}};
18073#elif defined(__PGI)
18074 result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}};
18075#elif defined(__SUNPRO_CC)
18076 result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}};
18077#else
18078 result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}};
18079#endif
18080#ifdef __cplusplus
18081 result["compiler"]["c++"] = std::to_string(__cplusplus);
18082#else
18083 result["compiler"]["c++"] = "unknown";
18084#endif
18085 return result;
18086 }
basic_json(const value_t v)
create an empty value with a given type
Definition: json.hpp:19164