diff --git a/docs/mkdocs/docs/api/json_pointer/operator_eq.md b/docs/mkdocs/docs/api/json_pointer/operator_eq.md index a877f4b2a2..807ae1d0ce 100644 --- a/docs/mkdocs/docs/api/json_pointer/operator_eq.md +++ b/docs/mkdocs/docs/api/json_pointer/operator_eq.md @@ -71,6 +71,12 @@ whether the values `lhs`/`*this` and `rhs` are equal Constant if `lhs` and `rhs` differ in the number of reference tokens, otherwise linear in the number of reference tokens. +## Notes + +!!! warning "Deprecation" + + Overload 2 is deprecated and will be removed in a future major version release. + ## Examples ??? example "Example: (1) Comparing JSON pointers" @@ -104,4 +110,4 @@ tokens. ## Version history 1. Added in version 2.1.0. Added C++20 member functions in version 3.11.2. -2. Added in version 3.11.2. +2. Added for backward compatibility and deprecated in version 3.11.2. diff --git a/docs/mkdocs/docs/api/json_pointer/operator_ne.md b/docs/mkdocs/docs/api/json_pointer/operator_ne.md index 05b09ce453..1f3e3247e0 100644 --- a/docs/mkdocs/docs/api/json_pointer/operator_ne.md +++ b/docs/mkdocs/docs/api/json_pointer/operator_ne.md @@ -69,6 +69,10 @@ tokens. Since C++20 overload resolution will consider the _rewritten candidate_ generated from [`operator==`](operator_eq.md). +!!! warning "Deprecation" + + Overload 2 is deprecated and will be removed in a future major version release. + ## Examples ??? example "Example: (1) Comparing JSON pointers" @@ -102,4 +106,4 @@ tokens. ## Version history 1. Added in version 2.1.0. -2. Added in version 3.11.2. +2. Added for backward compatibility and deprecated in version 3.11.2. diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index ce593e8430..663e95a5a7 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); @@ -935,6 +936,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) { @@ -943,6 +945,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) { @@ -958,6 +961,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) { @@ -966,6 +970,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 11fe578083..2689c4194e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -14518,6 +14518,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); @@ -14595,6 +14596,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) { @@ -14603,6 +14605,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) { @@ -14618,6 +14621,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) { @@ -14626,6 +14630,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) {