From cb5581392a8b1c71c0b8208126b6943c7c1ff856 Mon Sep 17 00:00:00 2001 From: Niels Date: Mon, 28 Dec 2015 14:51:57 +0100 Subject: [PATCH] preparing 1.0.0 release --- doc/ChangeLog.md | 22 +++++ src/json.hpp | 236 +++++++++++++++++++++++----------------------- src/json.hpp.re2c | 236 +++++++++++++++++++++++----------------------- 3 files changed, 258 insertions(+), 236 deletions(-) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index d6afa4f1..a43b0e1a 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,5 +1,27 @@ # JSON for Modern C++ +## Version 1.0.0 + +- Release date: 2015-12-28 +- MD5: 331c30e4407ecdcf591e9e3ed85100d0 + +### Summary + +This is the first official release. Compared to the [prerelease version 1.0.0-rc1](https://github.com/nlohmann/json/releases/tag/v1.0.0-rc1), only a few minor improvements have been made: + +### Changes + +- *Changed*: A **UTF-8 byte order mark** is silently ignored. +- *Changed*: `sprintf` is no longer used. +- *Changed*: `iterator_wrapper` also works for const objects; note: the name may change! +- *Changed*: **Error messages** during deserialization have been improved. +- *Added*: The `parse` function now also works with type `std::istream&&`. +- *Added*: Function `value(key, default_value)` returns either a copy of an object's element at the specified key or a given default value if no element with the key exists. +- *Added*: Public functions are tagged with the version they were introduced. This shall allow for better **versioning** in the future. +- *Added*: All public functions and types are **documented** (see http://nlohmann.github.io/json/) including executable examples. +- *Added*: Allocation of all types (in particular arrays, strings, and objects) is now exception-safe. +- *Added*: They descriptions of thrown exceptions have been overworked and are part of the tests suite and documentation. + ## Version 1.0.0-rc1 - Release date: 2015-07-26 diff --git a/src/json.hpp b/src/json.hpp index 6e5f515a..4b6b8790 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -32,7 +32,7 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation. @author [Niels Lohmann](http://nlohmann.me) @see https://github.com/nlohmann/json to download the source code -@version 1.0 +@version 1.0.0 */ #ifndef NLOHMANN_JSON_HPP @@ -73,7 +73,7 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation. /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann -@since version 1.0 +@since version 1.0.0 */ namespace nlohmann { @@ -81,7 +81,7 @@ namespace nlohmann /*! @brief unnamed namespace with internal helper functions -@since version 1.0 +@since version 1.0.0 */ namespace { @@ -171,7 +171,7 @@ default) @see RFC 7159 -@since version 1.0 +@since version 1.0.0 @nosubgrouping */ @@ -331,7 +331,7 @@ class basic_json @sa @ref array_t -- type for an array value - @since version 1.0 + @since version 1.0.0 */ using object_t = ObjectType>; @@ -428,7 +428,7 @@ class basic_json for any access to string values, a pointer of type `string_t*` must be dereferenced. - @since version 1.0 + @since version 1.0.0 */ using string_t = StringType; @@ -454,7 +454,7 @@ class basic_json Boolean values are stored directly inside a @ref basic_json type. - @since version 1.0 + @since version 1.0.0 */ using boolean_t = BooleanType; @@ -522,7 +522,7 @@ class basic_json @sa @ref number_float_t -- type for number values (floating-point) - @since version 1.0 + @since version 1.0.0 */ using number_integer_t = NumberIntegerType; @@ -587,7 +587,7 @@ class basic_json @sa @ref number_integer_t -- type for number values (integer) - @since version 1.0 + @since version 1.0.0 */ using number_float_t = NumberFloatType; @@ -606,7 +606,7 @@ class basic_json is_object(), @ref is_array(), @ref is_string(), @ref is_boolean(), @ref is_number(), and @ref is_discarded() rely on it. - @since version 1.0 + @since version 1.0.0 */ enum class value_t : uint8_t { @@ -645,7 +645,7 @@ class basic_json The actual storage for a JSON value of the @ref basic_json class. - @since version 1.0 + @since version 1.0.0 */ union json_value { @@ -749,7 +749,7 @@ class basic_json This enumeration lists the parser events that can trigger calling a callback function of type @ref parser_callback_t during parsing. - @since version 1.0 + @since version 1.0.0 */ enum class parse_event_t : uint8_t { @@ -814,7 +814,7 @@ class basic_json @sa @ref parse(std::istream&, parser_callback_t) or @ref parse(const string_t&, parser_callback_t) for examples - @since version 1.0 + @since version 1.0.0 */ using parser_callback_t = std::function; @@ -861,7 +861,7 @@ class basic_json @sa @ref basic_json(const number_integer_t) -- create a number (integer) value - @since version 1.0 + @since version 1.0.0 */ basic_json(const value_t value_type) : m_type(value_type), m_value(value_type) @@ -884,7 +884,7 @@ class basic_json @sa @ref basic_json(std::nullptr_t) -- create a `null` value - @since version 1.0 + @since version 1.0.0 */ basic_json() noexcept = default; @@ -905,7 +905,7 @@ class basic_json @sa @ref basic_json() -- default constructor (implicitly creating a `null` value) - @since version 1.0 + @since version 1.0.0 */ basic_json(std::nullptr_t) noexcept : basic_json(value_t::null) @@ -928,7 +928,7 @@ class basic_json @sa @ref basic_json(const CompatibleObjectType&) -- create an object value from a compatible STL container - @since version 1.0 + @since version 1.0.0 */ basic_json(const object_t& val) : m_type(value_t::object), m_value(val) @@ -955,7 +955,7 @@ class basic_json @sa @ref basic_json(const object_t&) -- create an object value - @since version 1.0 + @since version 1.0.0 */ template ) -- create a JSON object value from an initializer list - @since version 1.0 + @since version 1.0.0 */ basic_json(std::initializer_list init, bool type_deduction = true, @@ -1462,7 +1462,7 @@ class basic_json @sa @ref object(std::initializer_list) -- create a JSON object value from an initializer list - @since version 1.0 + @since version 1.0.0 */ static basic_json array(std::initializer_list init = std::initializer_list()) @@ -1502,7 +1502,7 @@ class basic_json @sa @ref array(std::initializer_list) -- create a JSON array value from an initializer list - @since version 1.0 + @since version 1.0.0 */ static basic_json object(std::initializer_list init = std::initializer_list()) @@ -1526,7 +1526,7 @@ class basic_json basic_json(size_type\, const basic_json&) constructor.,basic_json__size_type_basic_json} - @since version 1.0 + @since version 1.0.0 */ basic_json(size_type cnt, const basic_json& val) : m_type(value_t::array) @@ -1566,7 +1566,7 @@ class basic_json @liveexample{The example below shows several ways to create JSON values by specifying a subrange with iterators.,basic_json__InputIt_InputIt} - @since version 1.0 + @since version 1.0.0 */ template ::value and @@ -1792,7 +1792,7 @@ class basic_json - The complexity is linear. - All stored elements are destroyed and all memory is freed. - @since version 1.0 + @since version 1.0.0 */ ~basic_json() { @@ -1861,7 +1861,7 @@ class basic_json @see https://docs.python.org/2/library/json.html#json.dump - @since version 1.0 + @since version 1.0.0 */ string_t dump(const int indent = -1) const { @@ -1892,7 +1892,7 @@ class basic_json @liveexample{The following code exemplifies @ref type() for all JSON types.,type} - @since version 1.0 + @since version 1.0.0 */ value_t type() const noexcept { @@ -1913,7 +1913,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_primitive for all JSON types.,is_primitive} - @since version 1.0 + @since version 1.0.0 */ bool is_primitive() const noexcept { @@ -1933,7 +1933,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_structured for all JSON types.,is_structured} - @since version 1.0 + @since version 1.0.0 */ bool is_structured() const noexcept { @@ -1952,7 +1952,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_null for all JSON types.,is_null} - @since version 1.0 + @since version 1.0.0 */ bool is_null() const noexcept { @@ -1971,7 +1971,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_boolean for all JSON types.,is_boolean} - @since version 1.0 + @since version 1.0.0 */ bool is_boolean() const noexcept { @@ -1995,7 +1995,7 @@ class basic_json @sa @ref is_number_integer() -- check if value is an integer number @sa @ref is_number_float() -- check if value is a floating-point number - @since version 1.0 + @since version 1.0.0 */ bool is_number() const noexcept { @@ -2018,7 +2018,7 @@ class basic_json @sa @ref is_number() -- check if value is a number @sa @ref is_number_float() -- check if value is a floating-point number - @since version 1.0 + @since version 1.0.0 */ bool is_number_integer() const noexcept { @@ -2041,7 +2041,7 @@ class basic_json @sa @ref is_number() -- check if value is number @sa @ref is_number_integer() -- check if value is an integer number - @since version 1.0 + @since version 1.0.0 */ bool is_number_float() const noexcept { @@ -2060,7 +2060,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_object for all JSON types.,is_object} - @since version 1.0 + @since version 1.0.0 */ bool is_object() const noexcept { @@ -2079,7 +2079,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_array for all JSON types.,is_array} - @since version 1.0 + @since version 1.0.0 */ bool is_array() const noexcept { @@ -2098,7 +2098,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_string for all JSON types.,is_string} - @since version 1.0 + @since version 1.0.0 */ bool is_string() const noexcept { @@ -2122,7 +2122,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_discarded for all JSON types.,is_discarded} - @since version 1.0 + @since version 1.0.0 */ bool is_discarded() const noexcept { @@ -2142,7 +2142,7 @@ class basic_json @liveexample{The following code exemplifies the value_t operator for all JSON types.,operator__value_t} - @since version 1.0 + @since version 1.0.0 */ operator value_t() const noexcept { @@ -2434,7 +2434,7 @@ class basic_json @sa @ref operator ValueType() const for implicit conversion @sa @ref get() for pointer-member access - @since version 1.0 + @since version 1.0.0 */ template`.,operator__ValueType} - @since version 1.0 + @since version 1.0.0 */ template reference operator[](const T (&key)[n]) @@ -3021,7 +3021,7 @@ class basic_json with range checking @sa @ref value() for access by value with a default value - @since version 1.0 + @since version 1.0.0 */ template const_reference operator[](const T (&key)[n]) const @@ -3083,7 +3083,7 @@ class basic_json @sa @ref operator[](const typename object_t::key_type&) for unchecked access by reference - @since version 1.0 + @since version 1.0.0 */ template ilist) { @@ -4426,7 +4426,7 @@ class basic_json @liveexample{The example below shows how JSON arrays can be swapped.,swap__reference} - @since version 1.0 + @since version 1.0.0 */ void swap(reference other) noexcept ( std::is_nothrow_move_constructible::value and @@ -4457,7 +4457,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__array_t} - @since version 1.0 + @since version 1.0.0 */ void swap(array_t& other) { @@ -4490,7 +4490,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__object_t} - @since version 1.0 + @since version 1.0.0 */ void swap(object_t& other) { @@ -4523,7 +4523,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__string_t} - @since version 1.0 + @since version 1.0.0 */ void swap(string_t& other) { @@ -4556,7 +4556,7 @@ class basic_json - order: null < boolean < number < object < array < string - furthermore, each type is not smaller than itself - @since version 1.0 + @since version 1.0.0 */ friend bool operator<(const value_t lhs, const value_t rhs) { @@ -4602,7 +4602,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__equal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator==(const_reference lhs, const_reference rhs) noexcept { @@ -4660,7 +4660,7 @@ class basic_json @liveexample{The example compares several JSON types to the null pointer. ,operator__equal__nullptr_t} - @since version 1.0 + @since version 1.0.0 */ friend bool operator==(const_reference v, std::nullptr_t) noexcept { @@ -4690,7 +4690,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__notequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator!=(const_reference lhs, const_reference rhs) noexcept { @@ -4713,7 +4713,7 @@ class basic_json @liveexample{The example compares several JSON types to the null pointer. ,operator__notequal__nullptr_t} - @since version 1.0 + @since version 1.0.0 */ friend bool operator!=(const_reference v, std::nullptr_t) noexcept { @@ -4751,7 +4751,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__less} - @since version 1.0 + @since version 1.0.0 */ friend bool operator<(const_reference lhs, const_reference rhs) noexcept { @@ -4812,7 +4812,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__greater} - @since version 1.0 + @since version 1.0.0 */ friend bool operator<=(const_reference lhs, const_reference rhs) noexcept { @@ -4834,7 +4834,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__lessequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator>(const_reference lhs, const_reference rhs) noexcept { @@ -4856,7 +4856,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__greaterequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator>=(const_reference lhs, const_reference rhs) noexcept { @@ -4893,7 +4893,7 @@ class basic_json @liveexample{The example below shows the serialization with different parameters to `width` to adjust the indentation level.,operator_serialize} - @since version 1.0 + @since version 1.0.0 */ friend std::ostream& operator<<(std::ostream& o, const basic_json& j) { @@ -4950,7 +4950,7 @@ class basic_json @sa @ref parse(std::istream&, parser_callback_t) for a version that reads from an input stream - @since version 1.0 + @since version 1.0.0 */ static basic_json parse(const string_t& s, parser_callback_t cb = nullptr) { @@ -4979,7 +4979,7 @@ class basic_json @sa @ref parse(const string_t&, parser_callback_t) for a version that reads from a string - @since version 1.0 + @since version 1.0.0 */ static basic_json parse(std::istream& i, parser_callback_t cb = nullptr) { @@ -5015,7 +5015,7 @@ class basic_json @sa parse(std::istream&, parser_callback_t) for a variant with a parser callback function to filter values while parsing - @since version 1.0 + @since version 1.0.0 */ friend std::istream& operator<<(basic_json& j, std::istream& i) { @@ -5572,7 +5572,7 @@ class basic_json The iterator that can be moved to point (forward and backward) to any element in constant time. - @since version 1.0 + @since version 1.0.0 */ class const_iterator : public std::iterator { @@ -6074,7 +6074,7 @@ class basic_json - [OutputIterator](http://en.cppreference.com/w/cpp/concept/OutputIterator): It is possible to write to the pointed-to element. - @since version 1.0 + @since version 1.0.0 */ class iterator : public const_iterator { @@ -6213,7 +6213,7 @@ class basic_json It is possible to write to the pointed-to element (only if @a Base is @ref iterator). - @since version 1.0 + @since version 1.0.0 */ template class json_reverse_iterator : public std::reverse_iterator @@ -7806,7 +7806,7 @@ basic_json_parser_64: This type is the default specialization of the @ref basic_json class which uses the standard template types. -@since version 1.0 +@since version 1.0.0 */ using json = basic_json<>; } @@ -7822,7 +7822,7 @@ namespace std /*! @brief exchanges the values of two JSON objects -@since version 1.0 +@since version 1.0.0 */ template <> inline void swap(nlohmann::json& j1, @@ -7841,7 +7841,7 @@ struct hash /*! @brief return a hash value for a JSON object - @since version 1.0 + @since version 1.0.0 */ std::size_t operator()(const nlohmann::json& j) const { @@ -7862,7 +7862,7 @@ no parse error occurred. @param[in] s a string representation of a JSON object @return a JSON object -@since version 1.0 +@since version 1.0.0 */ inline nlohmann::json operator "" _json(const char* s, std::size_t) { diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 09bba9cd..0f6b0eaf 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -32,7 +32,7 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation. @author [Niels Lohmann](http://nlohmann.me) @see https://github.com/nlohmann/json to download the source code -@version 1.0 +@version 1.0.0 */ #ifndef NLOHMANN_JSON_HPP @@ -73,7 +73,7 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation. /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann -@since version 1.0 +@since version 1.0.0 */ namespace nlohmann { @@ -81,7 +81,7 @@ namespace nlohmann /*! @brief unnamed namespace with internal helper functions -@since version 1.0 +@since version 1.0.0 */ namespace { @@ -171,7 +171,7 @@ default) @see RFC 7159 -@since version 1.0 +@since version 1.0.0 @nosubgrouping */ @@ -331,7 +331,7 @@ class basic_json @sa @ref array_t -- type for an array value - @since version 1.0 + @since version 1.0.0 */ using object_t = ObjectType>; @@ -428,7 +428,7 @@ class basic_json for any access to string values, a pointer of type `string_t*` must be dereferenced. - @since version 1.0 + @since version 1.0.0 */ using string_t = StringType; @@ -454,7 +454,7 @@ class basic_json Boolean values are stored directly inside a @ref basic_json type. - @since version 1.0 + @since version 1.0.0 */ using boolean_t = BooleanType; @@ -522,7 +522,7 @@ class basic_json @sa @ref number_float_t -- type for number values (floating-point) - @since version 1.0 + @since version 1.0.0 */ using number_integer_t = NumberIntegerType; @@ -587,7 +587,7 @@ class basic_json @sa @ref number_integer_t -- type for number values (integer) - @since version 1.0 + @since version 1.0.0 */ using number_float_t = NumberFloatType; @@ -606,7 +606,7 @@ class basic_json is_object(), @ref is_array(), @ref is_string(), @ref is_boolean(), @ref is_number(), and @ref is_discarded() rely on it. - @since version 1.0 + @since version 1.0.0 */ enum class value_t : uint8_t { @@ -645,7 +645,7 @@ class basic_json The actual storage for a JSON value of the @ref basic_json class. - @since version 1.0 + @since version 1.0.0 */ union json_value { @@ -749,7 +749,7 @@ class basic_json This enumeration lists the parser events that can trigger calling a callback function of type @ref parser_callback_t during parsing. - @since version 1.0 + @since version 1.0.0 */ enum class parse_event_t : uint8_t { @@ -814,7 +814,7 @@ class basic_json @sa @ref parse(std::istream&, parser_callback_t) or @ref parse(const string_t&, parser_callback_t) for examples - @since version 1.0 + @since version 1.0.0 */ using parser_callback_t = std::function; @@ -861,7 +861,7 @@ class basic_json @sa @ref basic_json(const number_integer_t) -- create a number (integer) value - @since version 1.0 + @since version 1.0.0 */ basic_json(const value_t value_type) : m_type(value_type), m_value(value_type) @@ -884,7 +884,7 @@ class basic_json @sa @ref basic_json(std::nullptr_t) -- create a `null` value - @since version 1.0 + @since version 1.0.0 */ basic_json() noexcept = default; @@ -905,7 +905,7 @@ class basic_json @sa @ref basic_json() -- default constructor (implicitly creating a `null` value) - @since version 1.0 + @since version 1.0.0 */ basic_json(std::nullptr_t) noexcept : basic_json(value_t::null) @@ -928,7 +928,7 @@ class basic_json @sa @ref basic_json(const CompatibleObjectType&) -- create an object value from a compatible STL container - @since version 1.0 + @since version 1.0.0 */ basic_json(const object_t& val) : m_type(value_t::object), m_value(val) @@ -955,7 +955,7 @@ class basic_json @sa @ref basic_json(const object_t&) -- create an object value - @since version 1.0 + @since version 1.0.0 */ template ) -- create a JSON object value from an initializer list - @since version 1.0 + @since version 1.0.0 */ basic_json(std::initializer_list init, bool type_deduction = true, @@ -1462,7 +1462,7 @@ class basic_json @sa @ref object(std::initializer_list) -- create a JSON object value from an initializer list - @since version 1.0 + @since version 1.0.0 */ static basic_json array(std::initializer_list init = std::initializer_list()) @@ -1502,7 +1502,7 @@ class basic_json @sa @ref array(std::initializer_list) -- create a JSON array value from an initializer list - @since version 1.0 + @since version 1.0.0 */ static basic_json object(std::initializer_list init = std::initializer_list()) @@ -1526,7 +1526,7 @@ class basic_json basic_json(size_type\, const basic_json&) constructor.,basic_json__size_type_basic_json} - @since version 1.0 + @since version 1.0.0 */ basic_json(size_type cnt, const basic_json& val) : m_type(value_t::array) @@ -1566,7 +1566,7 @@ class basic_json @liveexample{The example below shows several ways to create JSON values by specifying a subrange with iterators.,basic_json__InputIt_InputIt} - @since version 1.0 + @since version 1.0.0 */ template ::value and @@ -1792,7 +1792,7 @@ class basic_json - The complexity is linear. - All stored elements are destroyed and all memory is freed. - @since version 1.0 + @since version 1.0.0 */ ~basic_json() { @@ -1861,7 +1861,7 @@ class basic_json @see https://docs.python.org/2/library/json.html#json.dump - @since version 1.0 + @since version 1.0.0 */ string_t dump(const int indent = -1) const { @@ -1892,7 +1892,7 @@ class basic_json @liveexample{The following code exemplifies @ref type() for all JSON types.,type} - @since version 1.0 + @since version 1.0.0 */ value_t type() const noexcept { @@ -1913,7 +1913,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_primitive for all JSON types.,is_primitive} - @since version 1.0 + @since version 1.0.0 */ bool is_primitive() const noexcept { @@ -1933,7 +1933,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_structured for all JSON types.,is_structured} - @since version 1.0 + @since version 1.0.0 */ bool is_structured() const noexcept { @@ -1952,7 +1952,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_null for all JSON types.,is_null} - @since version 1.0 + @since version 1.0.0 */ bool is_null() const noexcept { @@ -1971,7 +1971,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_boolean for all JSON types.,is_boolean} - @since version 1.0 + @since version 1.0.0 */ bool is_boolean() const noexcept { @@ -1995,7 +1995,7 @@ class basic_json @sa @ref is_number_integer() -- check if value is an integer number @sa @ref is_number_float() -- check if value is a floating-point number - @since version 1.0 + @since version 1.0.0 */ bool is_number() const noexcept { @@ -2018,7 +2018,7 @@ class basic_json @sa @ref is_number() -- check if value is a number @sa @ref is_number_float() -- check if value is a floating-point number - @since version 1.0 + @since version 1.0.0 */ bool is_number_integer() const noexcept { @@ -2041,7 +2041,7 @@ class basic_json @sa @ref is_number() -- check if value is number @sa @ref is_number_integer() -- check if value is an integer number - @since version 1.0 + @since version 1.0.0 */ bool is_number_float() const noexcept { @@ -2060,7 +2060,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_object for all JSON types.,is_object} - @since version 1.0 + @since version 1.0.0 */ bool is_object() const noexcept { @@ -2079,7 +2079,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_array for all JSON types.,is_array} - @since version 1.0 + @since version 1.0.0 */ bool is_array() const noexcept { @@ -2098,7 +2098,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_string for all JSON types.,is_string} - @since version 1.0 + @since version 1.0.0 */ bool is_string() const noexcept { @@ -2122,7 +2122,7 @@ class basic_json @liveexample{The following code exemplifies @ref is_discarded for all JSON types.,is_discarded} - @since version 1.0 + @since version 1.0.0 */ bool is_discarded() const noexcept { @@ -2142,7 +2142,7 @@ class basic_json @liveexample{The following code exemplifies the value_t operator for all JSON types.,operator__value_t} - @since version 1.0 + @since version 1.0.0 */ operator value_t() const noexcept { @@ -2434,7 +2434,7 @@ class basic_json @sa @ref operator ValueType() const for implicit conversion @sa @ref get() for pointer-member access - @since version 1.0 + @since version 1.0.0 */ template`.,operator__ValueType} - @since version 1.0 + @since version 1.0.0 */ template reference operator[](const T (&key)[n]) @@ -3021,7 +3021,7 @@ class basic_json with range checking @sa @ref value() for access by value with a default value - @since version 1.0 + @since version 1.0.0 */ template const_reference operator[](const T (&key)[n]) const @@ -3083,7 +3083,7 @@ class basic_json @sa @ref operator[](const typename object_t::key_type&) for unchecked access by reference - @since version 1.0 + @since version 1.0.0 */ template ilist) { @@ -4426,7 +4426,7 @@ class basic_json @liveexample{The example below shows how JSON arrays can be swapped.,swap__reference} - @since version 1.0 + @since version 1.0.0 */ void swap(reference other) noexcept ( std::is_nothrow_move_constructible::value and @@ -4457,7 +4457,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__array_t} - @since version 1.0 + @since version 1.0.0 */ void swap(array_t& other) { @@ -4490,7 +4490,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__object_t} - @since version 1.0 + @since version 1.0.0 */ void swap(object_t& other) { @@ -4523,7 +4523,7 @@ class basic_json @liveexample{The example below shows how JSON values can be swapped.,swap__string_t} - @since version 1.0 + @since version 1.0.0 */ void swap(string_t& other) { @@ -4556,7 +4556,7 @@ class basic_json - order: null < boolean < number < object < array < string - furthermore, each type is not smaller than itself - @since version 1.0 + @since version 1.0.0 */ friend bool operator<(const value_t lhs, const value_t rhs) { @@ -4602,7 +4602,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__equal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator==(const_reference lhs, const_reference rhs) noexcept { @@ -4660,7 +4660,7 @@ class basic_json @liveexample{The example compares several JSON types to the null pointer. ,operator__equal__nullptr_t} - @since version 1.0 + @since version 1.0.0 */ friend bool operator==(const_reference v, std::nullptr_t) noexcept { @@ -4690,7 +4690,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__notequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator!=(const_reference lhs, const_reference rhs) noexcept { @@ -4713,7 +4713,7 @@ class basic_json @liveexample{The example compares several JSON types to the null pointer. ,operator__notequal__nullptr_t} - @since version 1.0 + @since version 1.0.0 */ friend bool operator!=(const_reference v, std::nullptr_t) noexcept { @@ -4751,7 +4751,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__less} - @since version 1.0 + @since version 1.0.0 */ friend bool operator<(const_reference lhs, const_reference rhs) noexcept { @@ -4812,7 +4812,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__greater} - @since version 1.0 + @since version 1.0.0 */ friend bool operator<=(const_reference lhs, const_reference rhs) noexcept { @@ -4834,7 +4834,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__lessequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator>(const_reference lhs, const_reference rhs) noexcept { @@ -4856,7 +4856,7 @@ class basic_json @liveexample{The example demonstrates comparing several JSON types.,operator__greaterequal} - @since version 1.0 + @since version 1.0.0 */ friend bool operator>=(const_reference lhs, const_reference rhs) noexcept { @@ -4893,7 +4893,7 @@ class basic_json @liveexample{The example below shows the serialization with different parameters to `width` to adjust the indentation level.,operator_serialize} - @since version 1.0 + @since version 1.0.0 */ friend std::ostream& operator<<(std::ostream& o, const basic_json& j) { @@ -4950,7 +4950,7 @@ class basic_json @sa @ref parse(std::istream&, parser_callback_t) for a version that reads from an input stream - @since version 1.0 + @since version 1.0.0 */ static basic_json parse(const string_t& s, parser_callback_t cb = nullptr) { @@ -4979,7 +4979,7 @@ class basic_json @sa @ref parse(const string_t&, parser_callback_t) for a version that reads from a string - @since version 1.0 + @since version 1.0.0 */ static basic_json parse(std::istream& i, parser_callback_t cb = nullptr) { @@ -5015,7 +5015,7 @@ class basic_json @sa parse(std::istream&, parser_callback_t) for a variant with a parser callback function to filter values while parsing - @since version 1.0 + @since version 1.0.0 */ friend std::istream& operator<<(basic_json& j, std::istream& i) { @@ -5572,7 +5572,7 @@ class basic_json The iterator that can be moved to point (forward and backward) to any element in constant time. - @since version 1.0 + @since version 1.0.0 */ class const_iterator : public std::iterator { @@ -6074,7 +6074,7 @@ class basic_json - [OutputIterator](http://en.cppreference.com/w/cpp/concept/OutputIterator): It is possible to write to the pointed-to element. - @since version 1.0 + @since version 1.0.0 */ class iterator : public const_iterator { @@ -6213,7 +6213,7 @@ class basic_json It is possible to write to the pointed-to element (only if @a Base is @ref iterator). - @since version 1.0 + @since version 1.0.0 */ template class json_reverse_iterator : public std::reverse_iterator @@ -7085,7 +7085,7 @@ class basic_json This type is the default specialization of the @ref basic_json class which uses the standard template types. -@since version 1.0 +@since version 1.0.0 */ using json = basic_json<>; } @@ -7101,7 +7101,7 @@ namespace std /*! @brief exchanges the values of two JSON objects -@since version 1.0 +@since version 1.0.0 */ template <> inline void swap(nlohmann::json& j1, @@ -7120,7 +7120,7 @@ struct hash /*! @brief return a hash value for a JSON object - @since version 1.0 + @since version 1.0.0 */ std::size_t operator()(const nlohmann::json& j) const { @@ -7141,7 +7141,7 @@ no parse error occurred. @param[in] s a string representation of a JSON object @return a JSON object -@since version 1.0 +@since version 1.0.0 */ inline nlohmann::json operator "" _json(const char* s, std::size_t) {