You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the .at or .value functions on a ordered_json object with a parameter type of json_pointer there is a deprecation warning due to the following functions being called:
.at and .value should ideally not depend on deprecated functions unless they themselves are deprecated.
Minimal code example
using json = nlohmann::ordered_json;
using json_pointer = json::json_pointer;
int main() {
json j = {{"key", "value"}};
json_pointer ptr("/key");
auto value = j.at(ptr); //deprecation warning
return 0;
}
Error messages
warning: 'operator==' is deprecated: Since 3.11.2; use operator==(json_pointer, json_pointer) [-Wdeprecated-declarations]
...
while substituting deduced template arguments into functiontemplate'at' [with KeyType = json_pointer &, $1= (no value)]
Compiler and operating system
gcc & clang
Library version
3.11.3
Validation
The bug also occurs if the latest version from the develop branch is used.
Description
When using the .at or .value functions on a ordered_json object with a parameter type of json_pointer there is a deprecation warning due to the following functions being called:
template<typename RefStringTypeLhs, typename StringType = typename json_pointer::string_t>
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer))
inline bool operator==(const json_pointer& lhs, const StringType& rhs)
{
return lhs == json_pointer(rhs);
}
template<typename RefStringTypeRhs, typename StringType = typename json_pointer::string_t>
JSON_HEDLEY_DEPRECATED_FOR(3.11.2, operator==(json_pointer, json_pointer))
inline bool operator==(const StringType& lhs, const json_pointer& rhs)
{
return json_pointer(lhs) == rhs;
}
Reproduction steps
The sample code should illustrate the problem.
Expected vs. actual results
.at and .value should ideally not depend on deprecated functions unless they themselves are deprecated.
Minimal code example
Error messages
Compiler and operating system
gcc & clang
Library version
3.11.3
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: