🚨 fix warnings

This commit is contained in:
Niels Lohmann 2023-07-24 13:49:46 +02:00
parent 5d2754306d
commit 603dd13772
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
39 changed files with 44 additions and 257 deletions

View File

@ -156,7 +156,7 @@ pretty:
--pad-header \
--align-pointer=type \
--align-reference=type \
--add-brackets \
--add-braces \
--convert-tabs \
--close-templates \
--lineend=linux \

View File

@ -35,7 +35,6 @@ int main()
// output the changed array
std::cout << j["array"] << '\n';
// out_of_range.106
try
{

View File

@ -24,7 +24,6 @@ int main()
// output changed array
std::cout << object << '\n';
// exception type_error.304
try
{

View File

@ -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
{

View File

@ -22,7 +22,6 @@ int main()
// output changed array
std::cout << object << '\n';
// exception type_error.304
try
{

View File

@ -16,7 +16,6 @@ int main()
// output element with key "the ugly"
std::cout << object.at("the ugly") << '\n';
// exception type_error.304
try
{

View File

@ -17,7 +17,6 @@ int main()
// output changed array
std::cout << array << '\n';
// exception type_error.304
try
{

View File

@ -11,7 +11,6 @@ int main()
// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
// exception type_error.304
try
{

View File

@ -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
// =============

View File

@ -30,7 +30,6 @@ int main()
std::vector<short> v7;
std::unordered_map<std::string, json> v8;
// use explicit conversions
json_types["boolean"].get_to(v1);
json_types["number"]["integer"].get_to(v2);

View File

@ -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*

View File

@ -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*

View File

@ -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)
{

View File

@ -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)
{

View File

@ -25,7 +25,6 @@
#include <nlohmann/detail/meta/type_traits.hpp>
#include <nlohmann/detail/string_concat.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{

View File

@ -55,7 +55,6 @@ static inline bool little_endianness(int num = 1) noexcept
return *reinterpret_cast<char*>(&num) == 1;
}
///////////////////
// binary reader //
///////////////////

View File

@ -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<typename BaseInputAdapter, size_t T>
struct wide_string_input_helper;
@ -339,7 +337,6 @@ class wide_string_input_adapter
std::size_t utf8_bytes_filled = 0;
};
template<typename IteratorType, typename Enable = void>
struct iterator_input_adapter_factory
{

View File

@ -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

View File

@ -69,10 +69,10 @@ template<typename IteratorType> 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<IteratorType>::value
&& std::is_nothrow_move_constructible<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
&& std::is_nothrow_move_constructible<string_type>::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<IteratorType>::value
&& std::is_nothrow_move_assignable<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
&& std::is_nothrow_move_assignable<string_type>::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)

View File

@ -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);

View File

@ -217,7 +217,6 @@ template <typename... Ts>
struct is_default_constructible<const std::tuple<Ts...>>
: conjunction<is_default_constructible<Ts>...> {};
template <typename T, typename... Args>
struct is_constructible : std::is_constructible<T, Args...> {};
@ -233,7 +232,6 @@ struct is_constructible<std::tuple<Ts...>> : is_default_constructible<std::tuple
template <typename... Ts>
struct is_constructible<const std::tuple<Ts...>> : is_default_constructible<const std::tuple<Ts...>> {};
template<typename T, typename = void>
struct is_iterator_traits : std::false_type {};
@ -643,7 +641,6 @@ struct value_in_range_of_impl2<OfType, T, false, true>
}
};
template<typename OfType, typename T>
struct value_in_range_of_impl2<OfType, T, true, true>
{

View File

@ -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_t>::value&&
std::is_nothrow_move_assignable<value_t>::value&&
std::is_nothrow_move_constructible<json_value>::value&&
std::is_nothrow_move_constructible<json_value>::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
std::is_nothrow_move_assignable<json_value>::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_t>::value&&
std::is_nothrow_move_assignable<value_t>::value&&
std::is_nothrow_move_constructible<json_value>::value&&
std::is_nothrow_move_constructible<json_value>::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
std::is_nothrow_move_assignable<json_value>::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<typename InputType>
@ -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<nlohmann::NLOHMANN_BASIC_JSON_TPL>::value&& // NOLINT(misc-redundant-expression)
is_nothrow_move_constructible<nlohmann::NLOHMANN_BASIC_JSON_TPL>::value&& // NOLINT(misc-redundant-expression,cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
is_nothrow_move_assignable<nlohmann::NLOHMANN_BASIC_JSON_TPL>::value)
{
j1.swap(j2);

View File

@ -40,8 +40,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <utility>
// #include <nlohmann/detail/abi_macros.hpp>
@ -53,8 +51,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// 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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // transform
#include <array> // array
#include <forward_list> // forward_list
@ -178,8 +172,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef> // nullptr_t
#include <exception> // exception
#if JSON_DIAGNOSTICS
@ -198,8 +190,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cstddef> // size_t
#include <cstdint> // uint8_t
@ -214,8 +204,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <utility> // declval, pair
// #include <nlohmann/detail/meta/detected.hpp>
// __ _____ _____ _____
@ -226,8 +214,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <type_traits>
// #include <nlohmann/detail/meta/void_t.hpp>
@ -239,11 +225,8 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -257,7 +240,6 @@ template<typename ...Ts> using void_t = typename make_void<Ts...>::type;
} // namespace detail
NLOHMANN_JSON_NAMESPACE_END
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -317,7 +299,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/thirdparty/hedley/hedley.hpp>
// __ _____ _____ _____
// __| | __| | | | 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 <nlohmann/detail/abi_macros.hpp>
// 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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -3007,13 +2982,10 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef> // size_t
// #include <nlohmann/detail/abi_macros.hpp>
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> // array
#include <cstddef> // size_t
#include <type_traits> // 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/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -3223,8 +3192,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <limits> // numeric_limits
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
#include <utility> // declval
@ -3239,8 +3206,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <iterator> // random_access_iterator_tag
// #include <nlohmann/detail/abi_macros.hpp>
@ -3249,7 +3214,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/cpp_future.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -3307,11 +3271,8 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end);
@ -3362,7 +3320,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/abi_macros.hpp>
/*!
@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 <typename... Ts>
struct is_default_constructible<const std::tuple<Ts...>>
: conjunction<is_default_constructible<Ts>...> {};
template <typename T, typename... Args>
struct is_constructible : std::is_constructible<T, Args...> {};
@ -3633,7 +3588,6 @@ struct is_constructible<std::tuple<Ts...>> : is_default_constructible<std::tuple
template <typename... Ts>
struct is_constructible<const std::tuple<Ts...>> : is_default_constructible<const std::tuple<Ts...>> {};
template<typename T, typename = void>
struct is_iterator_traits : std::false_type {};
@ -4043,7 +3997,6 @@ struct value_in_range_of_impl2<OfType, T, false, true>
}
};
template<typename OfType, typename T>
struct value_in_range_of_impl2<OfType, T, true, true>
{
@ -4148,8 +4101,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstring> // strlen
#include <string> // string
#include <utility> // forward
@ -4158,7 +4109,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/detected.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -4559,11 +4504,8 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
#if JSON_HAS_EXPERIMENTAL_FILESYSTEM
#include <experimental/filesystem>
NLOHMANN_JSON_NAMESPACE_BEGIN
@ -4588,7 +4530,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -5065,8 +5006,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // copy
#include <iterator> // begin, end
#include <string> // string
@ -5085,8 +5024,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef> // size_t
#include <iterator> // input_iterator_tag
#include <string> // string, to_string
@ -5103,7 +5040,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -5151,10 +5087,10 @@ template<typename IteratorType> 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<IteratorType>::value
&& std::is_nothrow_move_constructible<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
&& std::is_nothrow_move_constructible<string_type>::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<IteratorType>::value
&& std::is_nothrow_move_assignable<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
&& std::is_nothrow_move_assignable<string_type>::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<N, ::nlohmann::detail::iteration_proxy_value<IteratorType >>
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -5757,7 +5692,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/identity_tag.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstdint> // uint8_t, uint64_t
#include <tuple> // tie
#include <utility> // move
// #include <nlohmann/detail/abi_macros.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstdint> // uint8_t
#include <cstddef> // size_t
#include <functional> // hash
@ -5928,7 +5857,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -6051,8 +5979,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // generate_n
#include <array> // array
#include <cmath> // ldexp
@ -6077,8 +6003,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cstddef> // size_t
#include <cstring> // strlen
@ -6098,7 +6022,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/macro_scope.hpp>
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<typename BaseInputAdapter, size_t T>
struct wide_string_input_helper;
@ -6412,7 +6333,6 @@ class wide_string_input_adapter
std::size_t utf8_bytes_filled = 0;
};
template<typename IteratorType, typename Enable = void>
struct iterator_input_adapter_factory
{
@ -6575,8 +6495,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef>
#include <string> // string
#include <utility> // move
@ -6588,7 +6506,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/string_concat.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <array> // array
#include <clocale> // localeconv
#include <cstddef> // size_t
@ -7326,7 +7240,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -8947,8 +8860,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstdint> // size_t
#include <utility> // declval
#include <string> // string
@ -8959,7 +8870,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/type_traits.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -9108,7 +9018,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -9133,7 +9042,6 @@ static inline bool little_endianness(int num = 1) noexcept
return *reinterpret_cast<char*>(&num) == 1;
}
///////////////////
// binary reader //
///////////////////
@ -12100,8 +12008,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cmath> // isfinite
#include <cstdint> // uint8_t
#include <functional> // function
@ -12125,7 +12031,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -12617,8 +12522,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
@ -12630,14 +12533,11 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef> // ptrdiff_t
#include <limits> // numeric_limits
// #include <nlohmann/detail/macro_scope.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
#include <type_traits> // conditional, is_const, remove_const
@ -12808,7 +12705,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -13551,15 +13447,12 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <cstddef> // ptrdiff_t
#include <iterator> // reverse_iterator
#include <utility> // declval
// #include <nlohmann/detail/abi_macros.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -13679,12 +13572,10 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/json_custom_base_class.hpp>
#include <type_traits> // conditional, is_same
// #include <nlohmann/detail/abi_macros.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -13720,8 +13611,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // all_of
#include <cctype> // isdigit
#include <cerrno> // errno, ERANGE
@ -13745,7 +13634,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
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 <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <initializer_list>
#include <utility>
@ -14724,7 +14610,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/type_traits.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -14807,8 +14692,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // reverse
#include <array> // array
#include <map> // map
@ -14833,8 +14716,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // copy
#include <cstddef> // size_t
#include <iterator> // back_inserter
@ -14849,7 +14730,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -14976,7 +14856,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/string_concat.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -16802,8 +16681,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <algorithm> // reverse, remove, fill, find, none_of
#include <array> // array
#include <clocale> // localeconv, lconv
@ -16827,8 +16704,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cmath> // signbit, isfinite
#include <cstdint> // intN_t, uintN_t
@ -16838,7 +16713,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -17952,7 +17826,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/value_t.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -18922,8 +18795,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT
#include <functional> // equal_to, less
#include <initializer_list> // initializer_list
#include <iterator> // input_iterator_tag, iterator_traits
@ -18937,7 +18808,6 @@ NLOHMANN_JSON_NAMESPACE_END
// #include <nlohmann/detail/meta/type_traits.hpp>
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 <any>
#include <string_view>
@ -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_t>::value&&
std::is_nothrow_move_assignable<value_t>::value&&
std::is_nothrow_move_constructible<json_value>::value&&
std::is_nothrow_move_constructible<json_value>::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
std::is_nothrow_move_assignable<json_value>::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_t>::value&&
std::is_nothrow_move_assignable<value_t>::value&&
std::is_nothrow_move_constructible<json_value>::value&&
std::is_nothrow_move_constructible<json_value>::value&& // NOLINT(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
std::is_nothrow_move_assignable<json_value>::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<typename InputType>
@ -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<nlohmann::NLOHMANN_BASIC_JSON_TPL>::value&& // NOLINT(misc-redundant-expression)
is_nothrow_move_constructible<nlohmann::NLOHMANN_BASIC_JSON_TPL>::value&& // NOLINT(misc-redundant-expression,cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
is_nothrow_move_assignable<nlohmann::NLOHMANN_BASIC_JSON_TPL>::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 <https://nlohmann.me>
// 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 <https://nlohmann.me>
// 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_

View File

@ -24,8 +24,6 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// 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

View File

@ -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
//////////////////////////////////////////////////////////////////////////////

View File

@ -14,7 +14,6 @@ using nlohmann::json;
#include <climits> // SIZE_MAX
#include <limits> // numeric_limits
template <typename OfType, typename T, bool MinInRange, bool MaxInRange>
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);

View File

@ -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<int>() % 3 == 0;
@ -364,6 +362,4 @@ TEST_CASE("algorithms")
}
}
}

View File

@ -14,7 +14,6 @@
#include <string>
#include <utility>
/* 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;

View File

@ -339,13 +339,13 @@ TEST_CASE("BJData")
std::vector<int32_t> 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")

View File

@ -919,7 +919,6 @@ TEST_CASE("BSON numerical data")
}
}
SECTION("signed std::int32_t: INT32_MIN .. INT32_MAX")
{
std::vector<int32_t> const numbers

View File

@ -241,13 +241,13 @@ TEST_CASE("CBOR")
const std::vector<int64_t> numbers
{
-65537,
-100000,
-1000000,
-10000000,
-100000000,
-1000000000,
-4294967296,
};
-100000,
-1000000,
-10000000,
-100000000,
-1000000000,
-4294967296,
};
for (const auto i : numbers)
{
CAPTURE(i)

View File

@ -172,7 +172,6 @@ TEST_CASE("constructors")
CHECK(j == j_reference);
}
SECTION("std::multimap<json::string_t, json>")
{
std::multimap<json::string_t, json> const o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};

View File

@ -229,7 +229,6 @@ using json_with_visitor_t = nlohmann::basic_json <
visitor_adaptor
>;
template <class Fnc>
void visitor_adaptor::visit(const Fnc& fnc) const
{

View File

@ -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&);

View File

@ -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")

View File

@ -479,11 +479,11 @@ TEST_CASE("MessagePack")
std::vector<int32_t> const numbers
{
-32769,
-65536,
-77777,
-1048576,
-2147483648LL,
};
-65536,
-77777,
-1048576,
-2147483648LL,
};
for (auto i : numbers)
{
CAPTURE(i)

View File

@ -12,7 +12,6 @@
using nlohmann::json;
using nlohmann::ordered_json;
TEST_CASE("ordered_json")
{
json j;

View File

@ -11,7 +11,6 @@
#include <nlohmann/json.hpp>
using nlohmann::ordered_map;
TEST_CASE("ordered_map")
{
SECTION("constructor")

View File

@ -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));