From c2532084a06cc7b7d2b713fe56bf5e831c4e5310 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sat, 6 Aug 2022 21:09:22 +0200 Subject: [PATCH] Deprecate json_pointer/string_t comparisons --- include/nlohmann/detail/json_pointer.hpp | 5 +++++ single_include/nlohmann/json.hpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index 28de45028..de3efd1eb 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -858,6 +858,7 @@ class json_pointer /// @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); @@ -922,6 +923,7 @@ inline bool operator==(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer)) inline bool operator==(const json_pointer& lhs, const StringType& rhs) { @@ -930,6 +932,7 @@ inline bool operator==(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer)) inline bool operator==(const StringType& lhs, const json_pointer& rhs) { @@ -945,6 +948,7 @@ inline bool operator!=(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer)) inline bool operator!=(const json_pointer& lhs, const StringType& rhs) { @@ -953,6 +957,7 @@ inline bool operator!=(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer)) inline bool operator!=(const StringType& lhs, const json_pointer& rhs) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index beee0136c..96ac44cf4 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -14460,6 +14460,7 @@ class json_pointer /// @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); @@ -14524,6 +14525,7 @@ inline bool operator==(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer)) inline bool operator==(const json_pointer& lhs, const StringType& rhs) { @@ -14532,6 +14534,7 @@ inline bool operator==(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer)) inline bool operator==(const StringType& lhs, const json_pointer& rhs) { @@ -14547,6 +14550,7 @@ inline bool operator!=(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer)) inline bool operator!=(const json_pointer& lhs, const StringType& rhs) { @@ -14555,6 +14559,7 @@ inline bool operator!=(const json_pointer& lhs, template::string_t> +JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator!=(json_pointer, json_pointer)) inline bool operator!=(const StringType& lhs, const json_pointer& rhs) {