diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 77dd000ed..482a99133 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3692,8 +3692,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec #endif } - // template::value, int>::type = 0> /// @brief comparison: equal /// @sa https://json.nlohmann.me/api/basic_json/operator_eq/ template @@ -3703,6 +3701,15 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec return *this == basic_json(rhs); } + /// @brief comparison: not equal + /// @sa https://json.nlohmann.me/api/basic_json/operator_eq/ + template + requires detail::json_compatible_type::value + bool operator!=(T rhs) const noexcept + { + return *this != basic_json(rhs); + } + /// @sa https://json.nlohmann.me/api/basic_json/operator_eq/ bool operator==(std::nullptr_t rhs) const noexcept {