mirror of
https://github.com/nlohmann/json.git
synced 2026-04-05 07:38:52 +00:00
Fix CI, again (#4083)
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include <nlohmann/detail/meta/type_traits.hpp>
|
||||
#include <nlohmann/detail/string_concat.hpp>
|
||||
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
namespace detail
|
||||
{
|
||||
|
||||
@@ -55,7 +55,6 @@ static inline bool little_endianness(int num = 1) noexcept
|
||||
return *reinterpret_cast<char*>(&num) == 1;
|
||||
}
|
||||
|
||||
|
||||
///////////////////
|
||||
// binary reader //
|
||||
///////////////////
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user