This commit is contained in:
nlohmann committed 2026-10-12 07:35:31 +00:00
1 parent 79119509a9
commit 22fba27145
555 files changed
+17342 -1394

No files matched your search

+27 -2
View File
@@ -25,13 +25,38 @@ Constant.
The example shows the usage of `pop_back`.
```cpp
--8<-- "examples/json_pointer__pop_back.cpp"
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create empty JSON Pointer
json::json_pointer ptr("/foo/bar/baz");
std::cout << "\"" << ptr << "\"\n";
// call pop_back()
ptr.pop_back();
std::cout << "\"" << ptr << "\"\n";
ptr.pop_back();
std::cout << "\"" << ptr << "\"\n";
ptr.pop_back();
std::cout << "\"" << ptr << "\"\n";
}
```
Output:
```json
--8<-- "examples/json_pointer__pop_back.output"
"/foo/bar/baz"
"/foo/bar"
"/foo"
""
```
## See also