1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-12 09:21:42 +03:00

📝 added example and documentation for the meta function

This commit is contained in:
Niels Lohmann
2017-01-28 17:12:29 +01:00
parent cdde1a9436
commit 38e4935db0
5 changed files with 69 additions and 2 deletions

View File

@ -1105,6 +1105,26 @@ class basic_json
/*!
@brief returns version information on the library
This function returns a JSON object with infiormation about the library,
including the version number and information on the platform and compiler.
@return 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](http://semver.org), and `string` (the version string).
@liveexample{The following code shows an example output of the `meta()`
function.,meta}
@complexity Constant.
@since 2.1.0
*/
static basic_json meta()
{
@ -8059,7 +8079,7 @@ class basic_json
@liveexample{The following code exemplifies `type_name()` for all JSON
types.,type_name}
@since version 1.0.0
@since version 1.0.0, public since 2.1.0
*/
std::string type_name() const
{