mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-20 11:46:36 +02:00
update nlohmann::json to v3.11.2
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// __ _____ _____ _____
|
||||
// __| | __| | | | JSON for Modern C++
|
||||
// | | |__ | | | | | | version 3.11.1
|
||||
// | | |__ | | | | | | version 3.11.2
|
||||
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
|
||||
@ -846,55 +846,143 @@ class json_pointer
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief compares two JSON pointers for equality
|
||||
public:
|
||||
#if JSON_HAS_THREE_WAY_COMPARISON
|
||||
/// @brief compares two JSON pointers for equality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_eq/
|
||||
template<typename RefStringTypeRhs>
|
||||
bool operator==(const json_pointer<RefStringTypeRhs>& rhs) const noexcept
|
||||
{
|
||||
return reference_tokens == rhs.reference_tokens;
|
||||
}
|
||||
|
||||
@param[in] lhs JSON pointer to compare
|
||||
@param[in] rhs JSON pointer to compare
|
||||
@return whether @a lhs is equal to @a rhs
|
||||
/// @brief compares JSON pointer and string for equality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_eq/
|
||||
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer))
|
||||
bool operator==(const string_t& rhs) const
|
||||
{
|
||||
return *this == json_pointer(rhs);
|
||||
}
|
||||
|
||||
@complexity Linear in the length of the JSON pointer
|
||||
|
||||
@exceptionsafety No-throw guarantee: this function never throws exceptions.
|
||||
*/
|
||||
/// @brief 3-way compares two JSON pointers
|
||||
template<typename RefStringTypeRhs>
|
||||
std::strong_ordering operator<=>(const json_pointer<RefStringTypeRhs>& rhs) const noexcept // *NOPAD*
|
||||
{
|
||||
return reference_tokens <=> rhs.reference_tokens; // *NOPAD*
|
||||
}
|
||||
#else
|
||||
/// @brief compares two JSON pointers for equality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_eq/
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator==(json_pointer<RefStringTypeLhs> const& lhs,
|
||||
json_pointer<RefStringTypeRhs> const& rhs) noexcept;
|
||||
friend bool operator==(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept;
|
||||
|
||||
/*!
|
||||
@brief compares two JSON pointers for inequality
|
||||
/// @brief compares JSON pointer and string for equality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_eq/
|
||||
template<typename RefStringTypeLhs, typename StringType>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator==(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const StringType& rhs);
|
||||
|
||||
@param[in] lhs JSON pointer to compare
|
||||
@param[in] rhs JSON pointer to compare
|
||||
@return whether @a lhs is not equal @a rhs
|
||||
/// @brief compares string and JSON pointer for equality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_eq/
|
||||
template<typename RefStringTypeRhs, typename StringType>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator==(const StringType& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs);
|
||||
|
||||
@complexity Linear in the length of the JSON pointer
|
||||
|
||||
@exceptionsafety No-throw guarantee: this function never throws exceptions.
|
||||
*/
|
||||
/// @brief compares two JSON pointers for inequality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_ne/
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator!=(json_pointer<RefStringTypeLhs> const& lhs,
|
||||
json_pointer<RefStringTypeRhs> const& rhs) noexcept;
|
||||
friend bool operator!=(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept;
|
||||
|
||||
/// @brief compares JSON pointer and string for inequality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_ne/
|
||||
template<typename RefStringTypeLhs, typename StringType>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator!=(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const StringType& rhs);
|
||||
|
||||
/// @brief compares string and JSON pointer for inequality
|
||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_ne/
|
||||
template<typename RefStringTypeRhs, typename StringType>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator!=(const StringType& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs);
|
||||
|
||||
/// @brief compares two JSON pointer for less-than
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
// NOLINTNEXTLINE(readability-redundant-declaration)
|
||||
friend bool operator<(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept;
|
||||
#endif
|
||||
|
||||
private:
|
||||
/// the reference tokens
|
||||
std::vector<string_t> reference_tokens;
|
||||
};
|
||||
|
||||
#if !JSON_HAS_THREE_WAY_COMPARISON
|
||||
// functions cannot be defined inside class due to ODR violations
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
inline bool operator==(json_pointer<RefStringTypeLhs> const& lhs,
|
||||
json_pointer<RefStringTypeRhs> const& rhs) noexcept
|
||||
inline bool operator==(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept
|
||||
{
|
||||
return lhs.reference_tokens == rhs.reference_tokens;
|
||||
}
|
||||
|
||||
template<typename RefStringTypeLhs,
|
||||
typename StringType = typename json_pointer<RefStringTypeLhs>::string_t>
|
||||
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer))
|
||||
inline bool operator==(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const StringType& rhs)
|
||||
{
|
||||
return lhs == json_pointer<RefStringTypeLhs>(rhs);
|
||||
}
|
||||
|
||||
template<typename RefStringTypeRhs,
|
||||
typename StringType = typename json_pointer<RefStringTypeRhs>::string_t>
|
||||
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer))
|
||||
inline bool operator==(const StringType& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs)
|
||||
{
|
||||
return json_pointer<RefStringTypeRhs>(lhs) == rhs;
|
||||
}
|
||||
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
inline bool operator!=(json_pointer<RefStringTypeLhs> const& lhs,
|
||||
json_pointer<RefStringTypeRhs> const& rhs) noexcept
|
||||
inline bool operator!=(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
template<typename RefStringTypeLhs,
|
||||
typename StringType = typename json_pointer<RefStringTypeLhs>::string_t>
|
||||
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer))
|
||||
inline bool operator!=(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const StringType& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
template<typename RefStringTypeRhs,
|
||||
typename StringType = typename json_pointer<RefStringTypeRhs>::string_t>
|
||||
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer))
|
||||
inline bool operator!=(const StringType& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
template<typename RefStringTypeLhs, typename RefStringTypeRhs>
|
||||
inline bool operator<(const json_pointer<RefStringTypeLhs>& lhs,
|
||||
const json_pointer<RefStringTypeRhs>& rhs) noexcept
|
||||
{
|
||||
return lhs.reference_tokens < rhs.reference_tokens;
|
||||
}
|
||||
#endif
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
Reference in New Issue
Block a user