|
99 | 99 | #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON |
100 | 100 | #endif |
101 | 101 |
|
| 102 | +#ifndef JSON_BRACE_INIT_COPY_SEMANTICS |
| 103 | + #define JSON_BRACE_INIT_COPY_SEMANTICS 0 |
| 104 | +#endif |
| 105 | + |
| 106 | +#if JSON_BRACE_INIT_COPY_SEMANTICS |
| 107 | + #define NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS _bics |
| 108 | +#else |
| 109 | + #define NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS |
| 110 | +#endif |
| 111 | + |
102 | 112 | #ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION |
103 | 113 | #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 |
104 | 114 | #endif |
105 | 115 |
|
106 | 116 | // Construct the namespace ABI tags component |
107 | | -#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c |
108 | | -#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ |
109 | | - NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) |
| 117 | +#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c, d) json_abi ## a ## b ## c ## d |
| 118 | +#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c, d) \ |
| 119 | + NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c, d) |
110 | 120 |
|
111 | | -#define NLOHMANN_JSON_ABI_TAGS \ |
112 | | - NLOHMANN_JSON_ABI_TAGS_CONCAT( \ |
113 | | - NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ |
114 | | - NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ |
115 | | - NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) |
| 121 | +#define NLOHMANN_JSON_ABI_TAGS \ |
| 122 | + NLOHMANN_JSON_ABI_TAGS_CONCAT( \ |
| 123 | + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ |
| 124 | + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ |
| 125 | + NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS, \ |
| 126 | + NLOHMANN_JSON_ABI_TAG_BRACE_INIT_COPY_SEMANTICS) |
116 | 127 |
|
117 | 128 | // Construct the namespace version component |
118 | 129 | #define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ |
@@ -2964,9 +2975,8 @@ JSON_HEDLEY_DIAGNOSTIC_POP |
2964 | 2975 | #define JSON_USE_GLOBAL_UDLS 1 |
2965 | 2976 | #endif |
2966 | 2977 |
|
2967 | | -#ifndef JSON_BRACE_INIT_COPY_SEMANTICS |
2968 | | - #define JSON_BRACE_INIT_COPY_SEMANTICS 0 |
2969 | | -#endif |
| 2978 | +// JSON_BRACE_INIT_COPY_SEMANTICS is defined and defaulted in abi_macros.hpp |
| 2979 | +// because it affects the inline namespace ABI tag. |
2970 | 2980 |
|
2971 | 2981 | #if JSON_HAS_THREE_WAY_COMPARISON |
2972 | 2982 | #include <compare> // partial_ordering |
@@ -3503,71 +3513,71 @@ NLOHMANN_JSON_NAMESPACE_END |
3503 | 3513 | // SPDX-License-Identifier: MIT |
3504 | 3514 |
|
3505 | 3515 | #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ |
3506 | | - #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ |
| 3516 | +#define INCLUDE_NLOHMANN_JSON_FWD_HPP_ |
3507 | 3517 |
|
3508 | | - #include <cstdint> // int64_t, uint64_t |
3509 | | - #include <map> // map |
3510 | | - #include <memory> // allocator |
3511 | | - #include <string> // string |
3512 | | - #include <vector> // vector |
| 3518 | +#include <cstdint> // int64_t, uint64_t |
| 3519 | +#include <map> // map |
| 3520 | +#include <memory> // allocator |
| 3521 | +#include <string> // string |
| 3522 | +#include <vector> // vector |
3513 | 3523 |
|
3514 | | - // #include <nlohmann/detail/abi_macros.hpp> |
| 3524 | +// #include <nlohmann/detail/abi_macros.hpp> |
3515 | 3525 |
|
3516 | 3526 |
|
3517 | | - /*! |
3518 | | - @brief namespace for Niels Lohmann |
3519 | | - @see https://github.com/nlohmann |
3520 | | - @since version 1.0.0 |
3521 | | - */ |
3522 | | - NLOHMANN_JSON_NAMESPACE_BEGIN |
| 3527 | +/*! |
| 3528 | +@brief namespace for Niels Lohmann |
| 3529 | +@see https://github.com/nlohmann |
| 3530 | +@since version 1.0.0 |
| 3531 | +*/ |
| 3532 | +NLOHMANN_JSON_NAMESPACE_BEGIN |
3523 | 3533 |
|
3524 | | - /*! |
3525 | | - @brief default JSONSerializer template argument |
| 3534 | +/*! |
| 3535 | +@brief default JSONSerializer template argument |
3526 | 3536 |
|
3527 | | - This serializer ignores the template arguments and uses ADL |
3528 | | - ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) |
3529 | | - for serialization. |
3530 | | - */ |
3531 | | - template<typename T = void, typename SFINAE = void> |
3532 | | - struct adl_serializer; |
3533 | | - |
3534 | | - /// a class to store JSON values |
3535 | | - /// @sa https://json.nlohmann.me/api/basic_json/ |
3536 | | - template<template<typename U, typename V, typename... Args> class ObjectType = |
3537 | | - std::map, |
3538 | | - template<typename U, typename... Args> class ArrayType = std::vector, |
3539 | | - class StringType = std::string, class BooleanType = bool, |
3540 | | - class NumberIntegerType = std::int64_t, |
3541 | | - class NumberUnsignedType = std::uint64_t, |
3542 | | - class NumberFloatType = double, |
3543 | | - template<typename U> class AllocatorType = std::allocator, |
3544 | | - template<typename T, typename SFINAE = void> class JSONSerializer = |
3545 | | - adl_serializer, |
3546 | | - class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError |
3547 | | - class CustomBaseClass = void> |
3548 | | - class basic_json; |
3549 | | - |
3550 | | - /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
3551 | | - /// @sa https://json.nlohmann.me/api/json_pointer/ |
3552 | | - template<typename RefStringType> |
3553 | | - class json_pointer; |
| 3537 | +This serializer ignores the template arguments and uses ADL |
| 3538 | +([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) |
| 3539 | +for serialization. |
| 3540 | +*/ |
| 3541 | +template<typename T = void, typename SFINAE = void> |
| 3542 | +struct adl_serializer; |
| 3543 | + |
| 3544 | +/// a class to store JSON values |
| 3545 | +/// @sa https://json.nlohmann.me/api/basic_json/ |
| 3546 | +template<template<typename U, typename V, typename... Args> class ObjectType = |
| 3547 | + std::map, |
| 3548 | + template<typename U, typename... Args> class ArrayType = std::vector, |
| 3549 | + class StringType = std::string, class BooleanType = bool, |
| 3550 | + class NumberIntegerType = std::int64_t, |
| 3551 | + class NumberUnsignedType = std::uint64_t, |
| 3552 | + class NumberFloatType = double, |
| 3553 | + template<typename U> class AllocatorType = std::allocator, |
| 3554 | + template<typename T, typename SFINAE = void> class JSONSerializer = |
| 3555 | + adl_serializer, |
| 3556 | + class BinaryType = std::vector<std::uint8_t>, // cppcheck-suppress syntaxError |
| 3557 | + class CustomBaseClass = void> |
| 3558 | +class basic_json; |
3554 | 3559 |
|
3555 | | - /*! |
3556 | | - @brief default specialization |
3557 | | - @sa https://json.nlohmann.me/api/json/ |
3558 | | - */ |
3559 | | - using json = basic_json<>; |
| 3560 | +/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
| 3561 | +/// @sa https://json.nlohmann.me/api/json_pointer/ |
| 3562 | +template<typename RefStringType> |
| 3563 | +class json_pointer; |
3560 | 3564 |
|
3561 | | - /// @brief a minimal map-like container that preserves insertion order |
3562 | | - /// @sa https://json.nlohmann.me/api/ordered_map/ |
3563 | | - template<class Key, class T, class IgnoredLess, class Allocator> |
3564 | | - struct ordered_map; |
| 3565 | +/*! |
| 3566 | +@brief default specialization |
| 3567 | +@sa https://json.nlohmann.me/api/json/ |
| 3568 | +*/ |
| 3569 | +using json = basic_json<>; |
| 3570 | + |
| 3571 | +/// @brief a minimal map-like container that preserves insertion order |
| 3572 | +/// @sa https://json.nlohmann.me/api/ordered_map/ |
| 3573 | +template<class Key, class T, class IgnoredLess, class Allocator> |
| 3574 | +struct ordered_map; |
3565 | 3575 |
|
3566 | | - /// @brief specialization that maintains the insertion order of object keys |
3567 | | - /// @sa https://json.nlohmann.me/api/ordered_json/ |
3568 | | - using ordered_json = basic_json<nlohmann::ordered_map>; |
| 3576 | +/// @brief specialization that maintains the insertion order of object keys |
| 3577 | +/// @sa https://json.nlohmann.me/api/ordered_json/ |
| 3578 | +using ordered_json = basic_json<nlohmann::ordered_map>; |
3569 | 3579 |
|
3570 | | - NLOHMANN_JSON_NAMESPACE_END |
| 3580 | +NLOHMANN_JSON_NAMESPACE_END |
3571 | 3581 |
|
3572 | 3582 | #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ |
3573 | 3583 |
|
@@ -5431,7 +5441,7 @@ NLOHMANN_JSON_NAMESPACE_END |
5431 | 5441 |
|
5432 | 5442 |
|
5433 | 5443 | // #include <nlohmann/detail/macro_scope.hpp> |
5434 | | -// JSON_HAS_CPP_17 |
| 5444 | + // JSON_HAS_CPP_17 |
5435 | 5445 | #ifdef JSON_HAS_CPP_17 |
5436 | 5446 | #include <optional> // optional |
5437 | 5447 | #endif |
@@ -20259,10 +20269,10 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
20259 | 20269 | const bool allow_exceptions = true, |
20260 | 20270 | const bool ignore_comments = false, |
20261 | 20271 | const bool ignore_trailing_commas = false |
20262 | | - ) |
| 20272 | + ) |
20263 | 20273 | { |
20264 | 20274 | return ::nlohmann::detail::parser<basic_json, InputAdapterType>(std::move(adapter), |
20265 | | - std::move(cb), allow_exceptions, ignore_comments, ignore_trailing_commas); |
| 20275 | + std::move(cb), allow_exceptions, ignore_comments, ignore_trailing_commas); |
20266 | 20276 | } |
20267 | 20277 |
|
20268 | 20278 | private: |
@@ -20960,8 +20970,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
20960 | 20970 | detail::enable_if_t < |
20961 | 20971 | !detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value, int > = 0 > |
20962 | 20972 | basic_json(CompatibleType && val) noexcept(noexcept( // NOLINT(bugprone-forwarding-reference-overload,bugprone-exception-escape) |
20963 | | - JSONSerializer<U>::to_json(std::declval<basic_json_t&>(), |
20964 | | - std::forward<CompatibleType>(val)))) |
| 20973 | + JSONSerializer<U>::to_json(std::declval<basic_json_t&>(), |
| 20974 | + std::forward<CompatibleType>(val)))) |
20965 | 20975 | { |
20966 | 20976 | JSONSerializer<U>::to_json(*this, std::forward<CompatibleType>(val)); |
20967 | 20977 | set_parents(); |
@@ -21764,7 +21774,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
21764 | 21774 | detail::has_from_json<basic_json_t, ValueType>::value, |
21765 | 21775 | int > = 0 > |
21766 | 21776 | ValueType get_impl(detail::priority_tag<0> /*unused*/) const noexcept(noexcept( |
21767 | | - JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>()))) |
| 21777 | + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), std::declval<ValueType&>()))) |
21768 | 21778 | { |
21769 | 21779 | auto ret = ValueType(); |
21770 | 21780 | JSONSerializer<ValueType>::from_json(*this, ret); |
@@ -21806,7 +21816,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
21806 | 21816 | detail::has_non_default_from_json<basic_json_t, ValueType>::value, |
21807 | 21817 | int > = 0 > |
21808 | 21818 | ValueType get_impl(detail::priority_tag<1> /*unused*/) const noexcept(noexcept( |
21809 | | - JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>()))) |
| 21819 | + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>()))) |
21810 | 21820 | { |
21811 | 21821 | return JSONSerializer<ValueType>::from_json(*this); |
21812 | 21822 | } |
@@ -21956,7 +21966,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec |
21956 | 21966 | detail::has_from_json<basic_json_t, ValueType>::value, |
21957 | 21967 | int > = 0 > |
21958 | 21968 | ValueType & get_to(ValueType& v) const noexcept(noexcept( |
21959 | | - JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v))) |
| 21969 | + JSONSerializer<ValueType>::from_json(std::declval<const basic_json_t&>(), v))) |
21960 | 21970 | { |
21961 | 21971 | JSONSerializer<ValueType>::from_json(*this, v); |
21962 | 21972 | return v; |
|
0 commit comments