Fix CI, again (#4083)

pull/4140/head
Niels Lohmann 2023-09-07 20:41:12 +02:00 committed by GitHub
parent 788e5468e4
commit 836b7beca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 45 additions and 172 deletions

View File

@ -156,7 +156,8 @@ pretty:
--pad-header \
--align-pointer=type \
--align-reference=type \
--add-brackets \
--add-braces \
--squeeze-lines=2 \
--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

@ -41,7 +41,6 @@
// SPDX-License-Identifier: MIT
#include <utility>
// #include <nlohmann/detail/abi_macros.hpp>
@ -54,7 +53,6 @@
// SPDX-License-Identifier: MIT
// This file contains all macro definitions affecting or depending on the ABI
#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
@ -156,7 +154,6 @@
// SPDX-License-Identifier: MIT
#include <algorithm> // transform
#include <array> // array
#include <forward_list> // forward_list
@ -179,7 +176,6 @@
// SPDX-License-Identifier: MIT
#include <cstddef> // nullptr_t
#include <exception> // exception
#if JSON_DIAGNOSTICS
@ -199,7 +195,6 @@
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cstddef> // size_t
#include <cstdint> // uint8_t
@ -215,7 +210,6 @@
// SPDX-License-Identifier: MIT
#include <utility> // declval, pair
// #include <nlohmann/detail/meta/detected.hpp>
// __ _____ _____ _____
@ -227,7 +221,6 @@
// SPDX-License-Identifier: MIT
#include <type_traits>
// #include <nlohmann/detail/meta/void_t.hpp>
@ -240,7 +233,6 @@
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
@ -2763,7 +2755,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);
@ -2933,7 +2924,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
@ -3008,7 +2998,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstddef> // size_t
// #include <nlohmann/detail/abi_macros.hpp>
@ -3051,7 +3040,6 @@ NLOHMANN_JSON_NAMESPACE_END
// 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
@ -3224,7 +3212,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <limits> // numeric_limits
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
#include <utility> // declval
@ -3240,7 +3227,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <iterator> // random_access_iterator_tag
// #include <nlohmann/detail/abi_macros.hpp>
@ -3308,7 +3294,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
@ -3328,7 +3313,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
@ -3617,7 +3601,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 +3616,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 +4025,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>
{
@ -4149,7 +4130,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstring> // strlen
#include <string> // string
#include <utility> // forward
@ -4290,7 +4270,6 @@ inline OutStringType concat(Args && ... args)
NLOHMANN_JSON_NAMESPACE_END
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
@ -4536,7 +4515,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
@ -4560,7 +4538,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/macro_scope.hpp>
@ -5066,7 +5043,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // copy
#include <iterator> // begin, end
#include <string> // string
@ -5086,7 +5062,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstddef> // size_t
#include <iterator> // input_iterator_tag
#include <string> // string, to_string
@ -5151,10 +5126,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)
@ -5807,7 +5782,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstdint> // uint8_t, uint64_t
#include <tuple> // tie
#include <utility> // move
@ -5919,7 +5893,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstdint> // uint8_t
#include <cstddef> // size_t
#include <functional> // hash
@ -6052,7 +6025,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // generate_n
#include <array> // array
#include <cmath> // ldexp
@ -6078,7 +6050,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cstddef> // size_t
#include <cstring> // strlen
@ -6144,7 +6115,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 +6213,6 @@ class iterator_input_adapter
}
};
template<typename BaseInputAdapter, size_t T>
struct wide_string_input_helper;
@ -6412,7 +6381,6 @@ class wide_string_input_adapter
std::size_t utf8_bytes_filled = 0;
};
template<typename IteratorType, typename Enable = void>
struct iterator_input_adapter_factory
{
@ -6576,7 +6544,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstddef>
#include <string> // string
#include <utility> // move
@ -6714,7 +6681,6 @@ struct json_sax
virtual ~json_sax() = default;
};
namespace detail
{
/*!
@ -7163,7 +7129,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 +7146,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
@ -7309,7 +7275,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <array> // array
#include <clocale> // localeconv
#include <cstddef> // size_t
@ -8948,7 +8913,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstdint> // size_t
#include <utility> // declval
#include <string> // string
@ -9133,7 +9097,6 @@ static inline bool little_endianness(int num = 1) noexcept
return *reinterpret_cast<char*>(&num) == 1;
}
///////////////////
// binary reader //
///////////////////
@ -12101,7 +12064,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cmath> // isfinite
#include <cstdint> // uint8_t
#include <functional> // function
@ -12618,7 +12580,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
// #include <nlohmann/detail/abi_macros.hpp>
// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
@ -12631,7 +12592,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstddef> // ptrdiff_t
#include <limits> // numeric_limits
@ -12790,7 +12750,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
#include <type_traits> // conditional, is_const, remove_const
@ -13552,7 +13511,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <cstddef> // ptrdiff_t
#include <iterator> // reverse_iterator
#include <utility> // declval
@ -13721,7 +13679,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // all_of
#include <cctype> // isdigit
#include <cerrno> // errno, ERANGE
@ -14716,7 +14673,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <initializer_list>
#include <utility>
@ -14808,7 +14764,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // reverse
#include <array> // array
#include <map> // map
@ -14834,7 +14789,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // copy
#include <cstddef> // size_t
#include <iterator> // back_inserter
@ -16803,7 +16757,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <algorithm> // reverse, remove, fill, find, none_of
#include <array> // array
#include <clocale> // localeconv, lconv
@ -16828,7 +16781,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <array> // array
#include <cmath> // signbit, isfinite
#include <cstdint> // intN_t, uintN_t
@ -18923,7 +18875,6 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT
#include <functional> // equal_to, less
#include <initializer_list> // initializer_list
#include <iterator> // input_iterator_tag, iterator_traits
@ -19408,7 +19359,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
/////////////////////
// container types //
/////////////////////
@ -19450,7 +19400,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 +19462,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 +19472,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
return result;
}
///////////////////////////
// JSON value data types //
///////////////////////////
@ -20346,7 +20293,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
assert_invariant();
}
///////////////////////////////////////
// other constructors and destructor //
///////////////////////////////////////
@ -21141,7 +21087,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
////////////////////
// element access //
////////////////////
@ -21856,7 +21801,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
////////////
// lookup //
////////////
@ -21974,7 +21918,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
///////////////
// iterators //
///////////////
@ -22113,7 +22056,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
//////////////
// capacity //
//////////////
@ -22235,7 +22177,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @}
///////////////
// modifiers //
///////////////
@ -22683,7 +22624,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 +22641,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 +22650,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 +22666,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 +22682,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 +22698,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 +23163,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
#endif // JSON_NO_IO
/// @}
/////////////////////
// deserialization //
/////////////////////
@ -23403,7 +23343,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
}
JSON_PRIVATE_UNLESS_TESTED:
//////////////////////
// member variables //
@ -23621,7 +23560,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 +23683,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 +23963,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 +24387,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);
@ -24475,7 +24412,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// SPDX-License-Identifier: MIT
// restore clang diagnostic settings
#if defined(__clang__)
#pragma clang diagnostic pop
@ -24519,7 +24455,6 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// SPDX-License-Identifier: MIT
#undef JSON_HEDLEY_ALWAYS_INLINE
#undef JSON_HEDLEY_ARM_VERSION
#undef JSON_HEDLEY_ARM_VERSION_CHECK
@ -24670,5 +24605,4 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
#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));