-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
kind: enhancement/improvementstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Description
-
Describe the feature in as much detail as possible.
Use json_pointer for erasing keys from json -
Include sample usage where appropriate.
#include "nlohmann/json.hpp"
#include <iostream>
int main() {
auto j = R"({"x": {"y": 1}})"_json;
nlohmann::json::json_pointer ptr("/x/y");
std::cout << "Delete by ptr: " << j.erase(ptr) << std::endl;
std::cout << "j: " << j << std::endl;
}
Actual output:
Delete by ptr: 0
j: {"x":{"y":1}}
Expected output:
Delete by ptr: 1
j: {"x":{}}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind: enhancement/improvementstate: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated