mirror of
https://github.com/nlohmann/json.git
synced 2025-07-22 15:21:52 +03:00
🔀 merge branch 'develop' into feature/manual_lexer
This commit is contained in:
88
src/json.hpp
88
src/json.hpp
@ -6395,6 +6395,28 @@ class basic_json
|
||||
return operator<(lhs_type, rhs_type);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: less than
|
||||
@copydoc operator<(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator<(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs < basic_json(rhs));
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: less than
|
||||
@copydoc operator<(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator<(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) < rhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: less than or equal
|
||||
|
||||
@ -6417,6 +6439,28 @@ class basic_json
|
||||
return not (rhs < lhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: less than or equal
|
||||
@copydoc operator<=(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator<=(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs <= basic_json(rhs));
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: less than or equal
|
||||
@copydoc operator<=(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator<=(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) <= rhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than
|
||||
|
||||
@ -6439,6 +6483,28 @@ class basic_json
|
||||
return not (lhs <= rhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than
|
||||
@copydoc operator>(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator>(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs > basic_json(rhs));
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than
|
||||
@copydoc operator>(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator>(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) > rhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than or equal
|
||||
|
||||
@ -6461,6 +6527,28 @@ class basic_json
|
||||
return not (lhs < rhs);
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than or equal
|
||||
@copydoc operator>=(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator>=(const_reference lhs, const ScalarType rhs) noexcept
|
||||
{
|
||||
return (lhs >= basic_json(rhs));
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief comparison: greater than or equal
|
||||
@copydoc operator>=(const_reference, const_reference)
|
||||
*/
|
||||
template<typename ScalarType, typename std::enable_if<
|
||||
std::is_scalar<ScalarType>::value, int>::type = 0>
|
||||
friend bool operator>=(const ScalarType lhs, const_reference rhs) noexcept
|
||||
{
|
||||
return (basic_json(lhs) >= rhs);
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user