diff --git a/Makefile b/Makefile index 6eff8663e..20c17ec96 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,7 @@ pretty: --pad-header \ --align-pointer=type \ --align-reference=type \ - --add-brackets \ + --add-braces \ --convert-tabs \ --close-templates \ --lineend=linux \ diff --git a/docs/examples/at__json_pointer.cpp b/docs/examples/at__json_pointer.cpp index 26dfd8edd..9cb6cf9a2 100644 --- a/docs/examples/at__json_pointer.cpp +++ b/docs/examples/at__json_pointer.cpp @@ -35,7 +35,6 @@ int main() // output the changed array std::cout << j["array"] << '\n'; - // out_of_range.106 try { diff --git a/docs/examples/at__keytype.c++17.cpp b/docs/examples/at__keytype.c++17.cpp index 3491cb9f7..e0d9b9e7b 100644 --- a/docs/examples/at__keytype.c++17.cpp +++ b/docs/examples/at__keytype.c++17.cpp @@ -24,7 +24,6 @@ int main() // output changed array std::cout << object << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/at__keytype_const.c++17.cpp b/docs/examples/at__keytype_const.c++17.cpp index ec93c7059..1f32f23a5 100644 --- a/docs/examples/at__keytype_const.c++17.cpp +++ b/docs/examples/at__keytype_const.c++17.cpp @@ -18,7 +18,6 @@ int main() // output element with key "the ugly" using string_view std::cout << object.at("the ugly"sv) << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/at__object_t_key_type.cpp b/docs/examples/at__object_t_key_type.cpp index 202f8a2ee..3a59d1a50 100644 --- a/docs/examples/at__object_t_key_type.cpp +++ b/docs/examples/at__object_t_key_type.cpp @@ -22,7 +22,6 @@ int main() // output changed array std::cout << object << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/at__object_t_key_type_const.cpp b/docs/examples/at__object_t_key_type_const.cpp index e5244f3f7..f41bab61a 100644 --- a/docs/examples/at__object_t_key_type_const.cpp +++ b/docs/examples/at__object_t_key_type_const.cpp @@ -16,7 +16,6 @@ int main() // output element with key "the ugly" std::cout << object.at("the ugly") << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/at__size_type.cpp b/docs/examples/at__size_type.cpp index 65baeddcf..001b51d59 100644 --- a/docs/examples/at__size_type.cpp +++ b/docs/examples/at__size_type.cpp @@ -17,7 +17,6 @@ int main() // output changed array std::cout << array << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/at__size_type_const.cpp b/docs/examples/at__size_type_const.cpp index faa4cffdd..e2bebf7ec 100644 --- a/docs/examples/at__size_type_const.cpp +++ b/docs/examples/at__size_type_const.cpp @@ -11,7 +11,6 @@ int main() // output element at index 2 (third element) std::cout << array.at(2) << '\n'; - // exception type_error.304 try { diff --git a/docs/examples/basic_json__CompatibleType.cpp b/docs/examples/basic_json__CompatibleType.cpp index e2f01aa63..f0d0cc1e7 100644 --- a/docs/examples/basic_json__CompatibleType.cpp +++ b/docs/examples/basic_json__CompatibleType.cpp @@ -55,7 +55,6 @@ int main() std::cout << j_mmap << '\n'; std::cout << j_ummap << "\n\n"; - // =========== // array types // =========== @@ -117,7 +116,6 @@ int main() std::cout << j_mset << '\n'; std::cout << j_umset << "\n\n"; - // ============ // string types // ============ @@ -138,7 +136,6 @@ int main() std::cout << j_string_literal << '\n'; std::cout << j_stdstring << "\n\n"; - // ============ // number types // ============ @@ -203,7 +200,6 @@ int main() std::cout << j_float_nan << '\n'; std::cout << j_double << "\n\n"; - // ============= // boolean types // ============= diff --git a/docs/examples/get_to.cpp b/docs/examples/get_to.cpp index 4705b172f..358c8d43a 100644 --- a/docs/examples/get_to.cpp +++ b/docs/examples/get_to.cpp @@ -30,7 +30,6 @@ int main() std::vector v7; std::unordered_map v8; - // use explicit conversions json_types["boolean"].get_to(v1); json_types["number"]["integer"].get_to(v2); diff --git a/docs/examples/operator_spaceship__const_reference.c++20.cpp b/docs/examples/operator_spaceship__const_reference.c++20.cpp index 3c6c8b8c5..9e7c9e9be 100644 --- a/docs/examples/operator_spaceship__const_reference.c++20.cpp +++ b/docs/examples/operator_spaceship__const_reference.c++20.cpp @@ -32,7 +32,6 @@ int main() json string = "foo"; json discarded = json(json::value_t::discarded); - // output values and comparisons std::cout << array_1 << " <=> " << array_2 << " := " << to_string(array_1 <=> array_2) << '\n'; // *NOPAD* std::cout << object_1 << " <=> " << object_2 << " := " << to_string(object_1 <=> object_2) << '\n'; // *NOPAD* diff --git a/docs/examples/operator_spaceship__scalartype.c++20.cpp b/docs/examples/operator_spaceship__scalartype.c++20.cpp index d9dc3ca49..ebb5b4349 100644 --- a/docs/examples/operator_spaceship__scalartype.c++20.cpp +++ b/docs/examples/operator_spaceship__scalartype.c++20.cpp @@ -31,7 +31,6 @@ int main() json number = 17; json string = "17"; - // output values and comparisons std::cout << std::boolalpha << std::fixed; std::cout << boolean << " <=> " << true << " := " << to_string(boolean <=> true) << '\n'; // *NOPAD* diff --git a/docs/examples/parse__istream__parser_callback_t.cpp b/docs/examples/parse__istream__parser_callback_t.cpp index afcaa39d0..2ef14dab2 100644 --- a/docs/examples/parse__istream__parser_callback_t.cpp +++ b/docs/examples/parse__istream__parser_callback_t.cpp @@ -33,7 +33,6 @@ int main() json j_complete = json::parse(ss); std::cout << std::setw(4) << j_complete << "\n\n"; - // define parser callback json::parser_callback_t cb = [](int depth, json::parse_event_t event, json & parsed) { diff --git a/docs/examples/parse__string__parser_callback_t.cpp b/docs/examples/parse__string__parser_callback_t.cpp index 2ae4410a8..19c6c448a 100644 --- a/docs/examples/parse__string__parser_callback_t.cpp +++ b/docs/examples/parse__string__parser_callback_t.cpp @@ -28,7 +28,6 @@ int main() json j_complete = json::parse(text); std::cout << std::setw(4) << j_complete << "\n\n"; - // define parser callback json::parser_callback_t cb = [](int depth, json::parse_event_t event, json & parsed) { diff --git a/include/nlohmann/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp index 23b390c25..c8c0a1373 100644 --- a/include/nlohmann/detail/exceptions.hpp +++ b/include/nlohmann/detail/exceptions.hpp @@ -25,7 +25,6 @@ #include #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index 832c36ddf..263fdb525 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -55,7 +55,6 @@ static inline bool little_endianness(int num = 1) noexcept return *reinterpret_cast(&num) == 1; } - /////////////////// // binary reader // /////////////////// diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index cf53b1d57..e4ae7a8dc 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -71,7 +71,6 @@ class file_input_adapter std::FILE* m_file; }; - /*! Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at beginning of input. Does not support changing the underlying std::streambuf @@ -170,7 +169,6 @@ class iterator_input_adapter } }; - template struct wide_string_input_helper; @@ -339,7 +337,6 @@ class wide_string_input_adapter std::size_t utf8_bytes_filled = 0; }; - template struct iterator_input_adapter_factory { diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index 1bf46c232..ce1c66065 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -142,7 +142,6 @@ struct json_sax virtual ~json_sax() = default; }; - namespace detail { /*! @@ -591,7 +590,7 @@ class json_sax_dom_callback_parser if (ref_stack.empty()) { root = std::move(value); - return {true, &root}; + return {true, & root}; } // skip this value if we already decided to skip the parent @@ -608,7 +607,7 @@ class json_sax_dom_callback_parser if (ref_stack.back()->is_array()) { ref_stack.back()->m_data.m_value.array->emplace_back(std::move(value)); - return {true, &(ref_stack.back()->m_data.m_value.array->back())}; + return {true, & (ref_stack.back()->m_data.m_value.array->back())}; } // object diff --git a/include/nlohmann/detail/iterators/iteration_proxy.hpp b/include/nlohmann/detail/iterators/iteration_proxy.hpp index 33bfc36ba..6920c14d2 100644 --- a/include/nlohmann/detail/iterators/iteration_proxy.hpp +++ b/include/nlohmann/detail/iterators/iteration_proxy.hpp @@ -69,10 +69,10 @@ template class iteration_proxy_value // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions iteration_proxy_value(iteration_proxy_value&&) noexcept(std::is_nothrow_move_constructible::value - && std::is_nothrow_move_constructible::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor) + && std::is_nothrow_move_constructible::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) iteration_proxy_value& operator=(iteration_proxy_value&&) noexcept(std::is_nothrow_move_assignable::value - && std::is_nothrow_move_assignable::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor) + && std::is_nothrow_move_assignable::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) ~iteration_proxy_value() = default; /// dereference operator (needed for range-based for) diff --git a/include/nlohmann/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp index 2870a4f1d..6a463833c 100644 --- a/include/nlohmann/detail/macro_scope.hpp +++ b/include/nlohmann/detail/macro_scope.hpp @@ -411,7 +411,6 @@ inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } - // inspired from https://stackoverflow.com/a/26745591 // allows to call any std function as if (e.g. with begin): // using std::begin; begin(x); diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index cfc7e5ad3..d2788bbd7 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -217,7 +217,6 @@ template struct is_default_constructible> : conjunction...> {}; - template struct is_constructible : std::is_constructible {}; @@ -233,7 +232,6 @@ struct is_constructible> : is_default_constructible struct is_constructible> : is_default_constructible> {}; - template struct is_iterator_traits : std::false_type {}; @@ -643,7 +641,6 @@ struct value_in_range_of_impl2 } }; - template struct value_in_range_of_impl2 { diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index a3c0af1e0..210553490 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -192,7 +192,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - ///////////////////// // container types // ///////////////////// @@ -234,7 +233,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /// @brief returns the allocator associated with the container /// @sa https://json.nlohmann.me/api/basic_json/get_allocator/ static allocator_type get_allocator() @@ -297,7 +295,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; #endif - #if defined(_MSVC_LANG) result["compiler"]["c++"] = std::to_string(_MSVC_LANG); #elif defined(__cplusplus) @@ -308,7 +305,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return result; } - /////////////////////////// // JSON value data types // /////////////////////////// @@ -1130,7 +1126,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec assert_invariant(); } - /////////////////////////////////////// // other constructors and destructor // /////////////////////////////////////// @@ -1925,7 +1920,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - //////////////////// // element access // //////////////////// @@ -2640,7 +2634,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - //////////// // lookup // //////////// @@ -2758,7 +2751,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /////////////// // iterators // /////////////// @@ -2897,7 +2889,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - ////////////// // capacity // ////////////// @@ -3019,7 +3010,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /////////////// // modifiers // /////////////// @@ -3467,7 +3457,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec void swap(reference other) noexcept ( std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value&& - std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_constructible::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) std::is_nothrow_move_assignable::value ) { @@ -3484,7 +3474,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec friend void swap(reference left, reference right) noexcept ( std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value&& - std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_constructible::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) std::is_nothrow_move_assignable::value ) { @@ -3493,7 +3483,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(array_t& other) // NOLINT(bugprone-exception-escape) + void swap(array_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for arrays if (JSON_HEDLEY_LIKELY(is_array())) @@ -3509,7 +3499,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(object_t& other) // NOLINT(bugprone-exception-escape) + void swap(object_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for objects if (JSON_HEDLEY_LIKELY(is_object())) @@ -3525,7 +3515,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(string_t& other) // NOLINT(bugprone-exception-escape) + void swap(string_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for strings if (JSON_HEDLEY_LIKELY(is_string())) @@ -3541,7 +3531,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(binary_t& other) // NOLINT(bugprone-exception-escape) + void swap(binary_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for strings if (JSON_HEDLEY_LIKELY(is_binary())) @@ -4006,7 +3996,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec #endif // JSON_NO_IO /// @} - ///////////////////// // deserialization // ///////////////////// @@ -4187,7 +4176,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec } } - JSON_PRIVATE_UNLESS_TESTED: ////////////////////// // member variables // @@ -4405,7 +4393,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return from_cbor(ptr, ptr + len, strict, allow_exceptions, tag_handler); } - JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(detail::span_input_adapter&& i, @@ -4529,7 +4516,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return res ? result : basic_json(value_t::discarded); } - /// @brief create a JSON value from an input in BJData format /// @sa https://json.nlohmann.me/api/basic_json/from_bjdata/ template @@ -4810,7 +4796,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; // wrapper for "remove" operation; remove value at ptr - const auto operation_remove = [this, &result](json_pointer & ptr) + const auto operation_remove = [this, & result](json_pointer & ptr) { // get reference to parent of JSON pointer ptr const auto last_path = ptr.back(); @@ -5234,7 +5220,7 @@ struct less< ::nlohmann::detail::value_t> // do not remove the space after '<', /// @sa https://json.nlohmann.me/api/basic_json/std_swap/ NLOHMANN_BASIC_JSON_TPL_DECLARATION inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC_JSON_TPL& j2) noexcept( // NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) - is_nothrow_move_constructible::value&& // NOLINT(misc-redundant-expression) + is_nothrow_move_constructible::value&& // NOLINT(misc-redundant-expression,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) is_nothrow_move_assignable::value) { j1.swap(j2); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ddd3131dc..2acb444ee 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -40,8 +40,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // #include @@ -53,8 +51,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // This file contains all macro definitions affecting or depending on the ABI #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK @@ -155,8 +151,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // transform #include // array #include // forward_list @@ -178,8 +172,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // nullptr_t #include // exception #if JSON_DIAGNOSTICS @@ -198,8 +190,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // array #include // size_t #include // uint8_t @@ -214,8 +204,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // declval, pair // #include // __ _____ _____ _____ @@ -226,8 +214,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // #include @@ -239,11 +225,8 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -257,7 +240,6 @@ template using void_t = typename make_void::type; } // namespace detail NLOHMANN_JSON_NAMESPACE_END - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -317,7 +299,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.2 @@ -2362,13 +2343,11 @@ JSON_HEDLEY_DIAGNOSTIC_POP #endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ - // This file contains all internal macro definitions (except those affecting ABI) // You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them // #include - // exclude unsupported compilers #if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) #if defined(__clang__) @@ -2763,7 +2742,6 @@ JSON_HEDLEY_DIAGNOSTIC_POP inline void to_json(nlohmann::json& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ inline void from_json(const nlohmann::json& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } - // inspired from https://stackoverflow.com/a/26745591 // allows to call any std function as if (e.g. with begin): // using std::begin; begin(x); @@ -2932,11 +2910,8 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -3007,13 +2982,10 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // size_t // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -3050,8 +3022,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2018 The Abseil Authors // SPDX-License-Identifier: MIT - - #include // array #include // size_t #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type @@ -3059,7 +3029,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -3223,8 +3192,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // numeric_limits #include // false_type, is_constructible, is_integral, is_same, true_type #include // declval @@ -3239,8 +3206,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // random_access_iterator_tag // #include @@ -3249,7 +3214,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -3307,11 +3271,8 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); @@ -3327,11 +3288,8 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); @@ -3362,7 +3320,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann @@ -3420,7 +3377,6 @@ NLOHMANN_JSON_NAMESPACE_END #endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ - NLOHMANN_JSON_NAMESPACE_BEGIN /*! @brief detail namespace with internal helper functions @@ -3617,7 +3573,6 @@ template struct is_default_constructible> : conjunction...> {}; - template struct is_constructible : std::is_constructible {}; @@ -3633,7 +3588,6 @@ struct is_constructible> : is_default_constructible struct is_constructible> : is_default_constructible> {}; - template struct is_iterator_traits : std::false_type {}; @@ -4043,7 +3997,6 @@ struct value_in_range_of_impl2 } }; - template struct value_in_range_of_impl2 { @@ -4148,8 +4101,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // strlen #include // string #include // forward @@ -4158,7 +4109,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -4289,8 +4239,6 @@ inline OutStringType concat(Args && ... args) } // namespace detail NLOHMANN_JSON_NAMESPACE_END - - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -4535,11 +4483,8 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -4559,11 +4504,8 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include - #if JSON_HAS_EXPERIMENTAL_FILESYSTEM #include NLOHMANN_JSON_NAMESPACE_BEGIN @@ -4588,7 +4530,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -5065,8 +5006,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // copy #include // begin, end #include // string @@ -5085,8 +5024,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // size_t #include // input_iterator_tag #include // string, to_string @@ -5103,7 +5040,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -5151,10 +5087,10 @@ template class iteration_proxy_value // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions iteration_proxy_value(iteration_proxy_value&&) noexcept(std::is_nothrow_move_constructible::value - && std::is_nothrow_move_constructible::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor) + && std::is_nothrow_move_constructible::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) iteration_proxy_value& operator=(iteration_proxy_value&&) noexcept(std::is_nothrow_move_assignable::value - && std::is_nothrow_move_assignable::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor) + && std::is_nothrow_move_assignable::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor,cppcoreguidelines-noexcept-move-operations) ~iteration_proxy_value() = default; /// dereference operator (needed for range-based for) @@ -5333,7 +5269,6 @@ class tuple_element> // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -5757,7 +5692,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN /// @sa https://json.nlohmann.me/api/adl_serializer/ @@ -5806,15 +5740,12 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // uint8_t, uint64_t #include // tie #include // move // #include - NLOHMANN_JSON_NAMESPACE_BEGIN /// @brief an internal type for a backed binary type @@ -5918,8 +5849,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // uint8_t #include // size_t #include // hash @@ -5928,7 +5857,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -6051,8 +5979,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // generate_n #include // array #include // ldexp @@ -6077,8 +6003,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // array #include // size_t #include // strlen @@ -6098,7 +6022,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -6144,7 +6067,6 @@ class file_input_adapter std::FILE* m_file; }; - /*! Input adapter for a (caching) istream. Ignores a UFT Byte Order Mark at beginning of input. Does not support changing the underlying std::streambuf @@ -6243,7 +6165,6 @@ class iterator_input_adapter } }; - template struct wide_string_input_helper; @@ -6412,7 +6333,6 @@ class wide_string_input_adapter std::size_t utf8_bytes_filled = 0; }; - template struct iterator_input_adapter_factory { @@ -6575,8 +6495,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include #include // string #include // move @@ -6588,7 +6506,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN /*! @@ -6714,7 +6631,6 @@ struct json_sax virtual ~json_sax() = default; }; - namespace detail { /*! @@ -7163,7 +7079,7 @@ class json_sax_dom_callback_parser if (ref_stack.empty()) { root = std::move(value); - return {true, &root}; + return {true, & root}; } // skip this value if we already decided to skip the parent @@ -7180,7 +7096,7 @@ class json_sax_dom_callback_parser if (ref_stack.back()->is_array()) { ref_stack.back()->m_data.m_value.array->emplace_back(std::move(value)); - return {true, &(ref_stack.back()->m_data.m_value.array->back())}; + return {true, & (ref_stack.back()->m_data.m_value.array->back())}; } // object @@ -7308,8 +7224,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // array #include // localeconv #include // size_t @@ -7326,7 +7240,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -8947,8 +8860,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // size_t #include // declval #include // string @@ -8959,7 +8870,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -9108,7 +9018,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -9133,7 +9042,6 @@ static inline bool little_endianness(int num = 1) noexcept return *reinterpret_cast(&num) == 1; } - /////////////////// // binary reader // /////////////////// @@ -12100,8 +12008,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // isfinite #include // uint8_t #include // function @@ -12125,7 +12031,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -12617,8 +12522,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // #include // #include @@ -12630,14 +12533,11 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // ptrdiff_t #include // numeric_limits // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -12756,7 +12656,6 @@ class primitive_iterator_t } // namespace detail NLOHMANN_JSON_NAMESPACE_END - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -12789,8 +12688,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next #include // conditional, is_const, remove_const @@ -12808,7 +12705,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -13551,15 +13447,12 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // ptrdiff_t #include // reverse_iterator #include // declval // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -13679,12 +13572,10 @@ NLOHMANN_JSON_NAMESPACE_END // #include - #include // conditional, is_same // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -13720,8 +13611,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // all_of #include // isdigit #include // errno, ERANGE @@ -13745,7 +13634,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document @@ -14715,8 +14603,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include #include @@ -14724,7 +14610,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -14807,8 +14692,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // reverse #include // array #include // map @@ -14833,8 +14716,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // copy #include // size_t #include // back_inserter @@ -14849,7 +14730,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -14976,7 +14856,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -16802,8 +16681,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // reverse, remove, fill, find, none_of #include // array #include // localeconv, lconv @@ -16827,8 +16704,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // array #include // signbit, isfinite #include // intN_t, uintN_t @@ -16838,7 +16713,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -17952,7 +17826,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN namespace detail { @@ -18922,8 +18795,6 @@ NLOHMANN_JSON_NAMESPACE_END // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #include // equal_to, less #include // initializer_list #include // input_iterator_tag, iterator_traits @@ -18937,7 +18808,6 @@ NLOHMANN_JSON_NAMESPACE_END // #include - NLOHMANN_JSON_NAMESPACE_BEGIN /// ordered_map: a minimal map-like container that preserves insertion order @@ -19276,7 +19146,6 @@ private: NLOHMANN_JSON_NAMESPACE_END - #if defined(JSON_HAS_CPP_17) #include #include @@ -19408,7 +19277,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - ///////////////////// // container types // ///////////////////// @@ -19450,7 +19318,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /// @brief returns the allocator associated with the container /// @sa https://json.nlohmann.me/api/basic_json/get_allocator/ static allocator_type get_allocator() @@ -19513,7 +19380,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; #endif - #if defined(_MSVC_LANG) result["compiler"]["c++"] = std::to_string(_MSVC_LANG); #elif defined(__cplusplus) @@ -19524,7 +19390,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return result; } - /////////////////////////// // JSON value data types // /////////////////////////// @@ -20346,7 +20211,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec assert_invariant(); } - /////////////////////////////////////// // other constructors and destructor // /////////////////////////////////////// @@ -21141,7 +21005,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - //////////////////// // element access // //////////////////// @@ -21856,7 +21719,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - //////////// // lookup // //////////// @@ -21974,7 +21836,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /////////////// // iterators // /////////////// @@ -22113,7 +21974,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - ////////////// // capacity // ////////////// @@ -22235,7 +22095,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @} - /////////////// // modifiers // /////////////// @@ -22683,7 +22542,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec void swap(reference other) noexcept ( std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value&& - std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_constructible::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) std::is_nothrow_move_assignable::value ) { @@ -22700,7 +22559,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec friend void swap(reference left, reference right) noexcept ( std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value&& - std::is_nothrow_move_constructible::value&& + std::is_nothrow_move_constructible::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap) std::is_nothrow_move_assignable::value ) { @@ -22709,7 +22568,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(array_t& other) // NOLINT(bugprone-exception-escape) + void swap(array_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for arrays if (JSON_HEDLEY_LIKELY(is_array())) @@ -22725,7 +22584,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(object_t& other) // NOLINT(bugprone-exception-escape) + void swap(object_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for objects if (JSON_HEDLEY_LIKELY(is_object())) @@ -22741,7 +22600,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(string_t& other) // NOLINT(bugprone-exception-escape) + void swap(string_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for strings if (JSON_HEDLEY_LIKELY(is_string())) @@ -22757,7 +22616,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief exchanges the values /// @sa https://json.nlohmann.me/api/basic_json/swap/ - void swap(binary_t& other) // NOLINT(bugprone-exception-escape) + void swap(binary_t& other) // NOLINT(bugprone-exception-escape,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) { // swap only works for strings if (JSON_HEDLEY_LIKELY(is_binary())) @@ -23222,7 +23081,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec #endif // JSON_NO_IO /// @} - ///////////////////// // deserialization // ///////////////////// @@ -23403,7 +23261,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec } } - JSON_PRIVATE_UNLESS_TESTED: ////////////////////// // member variables // @@ -23621,7 +23478,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return from_cbor(ptr, ptr + len, strict, allow_exceptions, tag_handler); } - JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_cbor(ptr, ptr + len)) static basic_json from_cbor(detail::span_input_adapter&& i, @@ -23745,7 +23601,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return res ? result : basic_json(value_t::discarded); } - /// @brief create a JSON value from an input in BJData format /// @sa https://json.nlohmann.me/api/basic_json/from_bjdata/ template @@ -24026,7 +23881,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec }; // wrapper for "remove" operation; remove value at ptr - const auto operation_remove = [this, &result](json_pointer & ptr) + const auto operation_remove = [this, & result](json_pointer & ptr) { // get reference to parent of JSON pointer ptr const auto last_path = ptr.back(); @@ -24450,7 +24305,7 @@ struct less< ::nlohmann::detail::value_t> // do not remove the space after '<', /// @sa https://json.nlohmann.me/api/basic_json/std_swap/ NLOHMANN_BASIC_JSON_TPL_DECLARATION inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC_JSON_TPL& j2) noexcept( // NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) - is_nothrow_move_constructible::value&& // NOLINT(misc-redundant-expression) + is_nothrow_move_constructible::value&& // NOLINT(misc-redundant-expression,cppcoreguidelines-noexcept-swap,performance-noexcept-swap) is_nothrow_move_assignable::value) { j1.swap(j2); @@ -24474,8 +24329,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // restore clang diagnostic settings #if defined(__clang__) #pragma clang diagnostic pop @@ -24518,8 +24371,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - #undef JSON_HEDLEY_ALWAYS_INLINE #undef JSON_HEDLEY_ARM_VERSION #undef JSON_HEDLEY_ARM_VERSION_CHECK @@ -24669,6 +24520,4 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG #undef JSON_HEDLEY_FALL_THROUGH - - #endif // INCLUDE_NLOHMANN_JSON_HPP_ diff --git a/single_include/nlohmann/json_fwd.hpp b/single_include/nlohmann/json_fwd.hpp index 98070dfc9..4940d1e9d 100644 --- a/single_include/nlohmann/json_fwd.hpp +++ b/single_include/nlohmann/json_fwd.hpp @@ -24,8 +24,6 @@ // SPDX-FileCopyrightText: 2013-2022 Niels Lohmann // SPDX-License-Identifier: MIT - - // This file contains all macro definitions affecting or depending on the ABI #ifndef JSON_SKIP_LIBRARY_VERSION_CHECK @@ -117,7 +115,6 @@ } // namespace nlohmann #endif - /*! @brief namespace for Niels Lohmann @see https://github.com/nlohmann diff --git a/tests/benchmarks/src/benchmarks.cpp b/tests/benchmarks/src/benchmarks.cpp index 6c3d4d5a7..a105f692f 100644 --- a/tests/benchmarks/src/benchmarks.cpp +++ b/tests/benchmarks/src/benchmarks.cpp @@ -81,7 +81,6 @@ BENCHMARK_CAPTURE(ParseString, signed_ints, TEST_DATA_DIRECTORY "/regressi BENCHMARK_CAPTURE(ParseString, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json"); BENCHMARK_CAPTURE(ParseString, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json"); - ////////////////////////////////////////////////////////////////////////////// // serialize JSON ////////////////////////////////////////////////////////////////////////////// @@ -116,7 +115,6 @@ BENCHMARK_CAPTURE(Dump, unsigned_ints / 4, TEST_DATA_DIRECTORY "/regression/ BENCHMARK_CAPTURE(Dump, small_signed_ints / -, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json", -1); BENCHMARK_CAPTURE(Dump, small_signed_ints / 4, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json", 4); - ////////////////////////////////////////////////////////////////////////////// // serialize CBOR ////////////////////////////////////////////////////////////////////////////// diff --git a/tests/src/unit-32bit.cpp b/tests/src/unit-32bit.cpp index d3f9c3ef7..68c1e3ccb 100644 --- a/tests/src/unit-32bit.cpp +++ b/tests/src/unit-32bit.cpp @@ -14,7 +14,6 @@ using nlohmann::json; #include // SIZE_MAX #include // numeric_limits - template struct trait_test_arg { @@ -88,7 +87,6 @@ TEST_CASE_TEMPLATE_DEFINE("value_in_range_of trait", T, value_in_range_of_test) } } - TEST_CASE("32bit") { REQUIRE(SIZE_MAX == 0xffffffff); diff --git a/tests/src/unit-algorithms.cpp b/tests/src/unit-algorithms.cpp index 3ecaacde4..d51479eab 100644 --- a/tests/src/unit-algorithms.cpp +++ b/tests/src/unit-algorithms.cpp @@ -319,7 +319,6 @@ TEST_CASE("algorithms") } } - SECTION("copy") { SECTION("copy without if") @@ -336,7 +335,6 @@ TEST_CASE("algorithms") json dest_arr; const json source_arr = {0, 3, 6, 9, 12, 15, 20}; - std::copy_if(source_arr.begin(), source_arr.end(), std::back_inserter(dest_arr), [](const json & _value) { return _value.get() % 3 == 0; @@ -364,6 +362,4 @@ TEST_CASE("algorithms") } } - - } diff --git a/tests/src/unit-alt-string.cpp b/tests/src/unit-alt-string.cpp index 291c0ad5f..3d6b0704f 100644 --- a/tests/src/unit-alt-string.cpp +++ b/tests/src/unit-alt-string.cpp @@ -14,7 +14,6 @@ #include #include - /* forward declarations */ class alt_string; bool operator<(const char* op1, const alt_string& op2) noexcept; @@ -180,7 +179,6 @@ using alt_json = nlohmann::basic_json < std::allocator, nlohmann::adl_serializer >; - bool operator<(const char* op1, const alt_string& op2) noexcept { return op1 < op2.str_impl; diff --git a/tests/src/unit-bjdata.cpp b/tests/src/unit-bjdata.cpp index f943eb0db..1aa3c22b0 100644 --- a/tests/src/unit-bjdata.cpp +++ b/tests/src/unit-bjdata.cpp @@ -339,13 +339,13 @@ TEST_CASE("BJData") std::vector const numbers { -32769, - -100000, - -1000000, - -10000000, - -100000000, - -1000000000, - -2147483647 - 1, // https://stackoverflow.com/a/29356002/266378 - }; + -100000, + -1000000, + -10000000, + -100000000, + -1000000000, + -2147483647 - 1, // https://stackoverflow.com/a/29356002/266378 + }; for (const auto i : numbers) { CAPTURE(i) @@ -1499,7 +1499,6 @@ TEST_CASE("BJData") } } - SECTION("binary") { SECTION("N = 0..127") diff --git a/tests/src/unit-bson.cpp b/tests/src/unit-bson.cpp index c85e4e1ee..83a385a0a 100644 --- a/tests/src/unit-bson.cpp +++ b/tests/src/unit-bson.cpp @@ -919,7 +919,6 @@ TEST_CASE("BSON numerical data") } } - SECTION("signed std::int32_t: INT32_MIN .. INT32_MAX") { std::vector const numbers diff --git a/tests/src/unit-cbor.cpp b/tests/src/unit-cbor.cpp index 60e2dc9e0..1691bf541 100644 --- a/tests/src/unit-cbor.cpp +++ b/tests/src/unit-cbor.cpp @@ -241,13 +241,13 @@ TEST_CASE("CBOR") const std::vector numbers { -65537, - -100000, - -1000000, - -10000000, - -100000000, - -1000000000, - -4294967296, - }; + -100000, + -1000000, + -10000000, + -100000000, + -1000000000, + -4294967296, + }; for (const auto i : numbers) { CAPTURE(i) diff --git a/tests/src/unit-constructor1.cpp b/tests/src/unit-constructor1.cpp index cc9f2c4d5..3fe847887 100644 --- a/tests/src/unit-constructor1.cpp +++ b/tests/src/unit-constructor1.cpp @@ -172,7 +172,6 @@ TEST_CASE("constructors") CHECK(j == j_reference); } - SECTION("std::multimap") { std::multimap const o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}}; diff --git a/tests/src/unit-custom-base-class.cpp b/tests/src/unit-custom-base-class.cpp index 673147f90..ca916a9b9 100644 --- a/tests/src/unit-custom-base-class.cpp +++ b/tests/src/unit-custom-base-class.cpp @@ -229,7 +229,6 @@ using json_with_visitor_t = nlohmann::basic_json < visitor_adaptor >; - template void visitor_adaptor::visit(const Fnc& fnc) const { diff --git a/tests/src/unit-element_access2.cpp b/tests/src/unit-element_access2.cpp index db20a02b1..70d73f214 100644 --- a/tests/src/unit-element_access2.cpp +++ b/tests/src/unit-element_access2.cpp @@ -72,7 +72,6 @@ TEST_CASE_TEMPLATE("element access 2", Json, nlohmann::json, nlohmann::ordered_j CHECK_THROWS_WITH_AS(j.at("foo"), "[json.exception.out_of_range.403] key 'foo' not found", typename Json::out_of_range&); CHECK_THROWS_WITH_AS(j_const.at("foo"), "[json.exception.out_of_range.403] key 'foo' not found", typename Json::out_of_range&); - #ifdef JSON_HAS_CPP_17 CHECK_THROWS_WITH_AS(j.at(std::string_view("foo")), "[json.exception.out_of_range.403] key 'foo' not found", typename Json::out_of_range&); CHECK_THROWS_WITH_AS(j_const.at(std::string_view("foo")), "[json.exception.out_of_range.403] key 'foo' not found", typename Json::out_of_range&); diff --git a/tests/src/unit-iterators2.cpp b/tests/src/unit-iterators2.cpp index 72a5d9dc5..403da8ee6 100644 --- a/tests/src/unit-iterators2.cpp +++ b/tests/src/unit-iterators2.cpp @@ -873,7 +873,6 @@ TEST_CASE("iterators 2") } } - #if JSON_HAS_RANGES // JSON_HAS_CPP_20 (do not remove; see note at top of file) SECTION("ranges") diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp index 805a152e1..fa1dac82c 100644 --- a/tests/src/unit-msgpack.cpp +++ b/tests/src/unit-msgpack.cpp @@ -479,11 +479,11 @@ TEST_CASE("MessagePack") std::vector const numbers { -32769, - -65536, - -77777, - -1048576, - -2147483648LL, - }; + -65536, + -77777, + -1048576, + -2147483648LL, + }; for (auto i : numbers) { CAPTURE(i) diff --git a/tests/src/unit-ordered_json.cpp b/tests/src/unit-ordered_json.cpp index 4e853cc3c..8a4decfd6 100644 --- a/tests/src/unit-ordered_json.cpp +++ b/tests/src/unit-ordered_json.cpp @@ -12,7 +12,6 @@ using nlohmann::json; using nlohmann::ordered_json; - TEST_CASE("ordered_json") { json j; diff --git a/tests/src/unit-ordered_map.cpp b/tests/src/unit-ordered_map.cpp index 57692c3d8..0dbd80672 100644 --- a/tests/src/unit-ordered_map.cpp +++ b/tests/src/unit-ordered_map.cpp @@ -11,7 +11,6 @@ #include using nlohmann::ordered_map; - TEST_CASE("ordered_map") { SECTION("constructor") diff --git a/tests/src/unit-regression1.cpp b/tests/src/unit-regression1.cpp index 2b6e90b30..284ebd014 100644 --- a/tests/src/unit-regression1.cpp +++ b/tests/src/unit-regression1.cpp @@ -1203,7 +1203,6 @@ TEST_CASE("regression tests 1") CHECK(j["a"] >= 3); CHECK(j["a"] > 3); - CHECK(!(j["a"] <= 4)); CHECK(!(j["a"] < 4)); CHECK(!(j["a"] >= 6));